Hey :)
I'm new to java networking and I'm building a app where I need to upload/downlad a file to/from server.
How can I upload and download files from a web server? ftp!?!?
I'm not building a web application(servlets, jsp etc)
Printable View
Hey :)
I'm new to java networking and I'm building a app where I need to upload/downlad a file to/from server.
How can I upload and download files from a web server? ftp!?!?
I'm not building a web application(servlets, jsp etc)
FTP can be used for uploading and downloading files to/from a FTP server.
There are probably third party packages that handle that protocol. Or you could write your own FTP code.
Try Google
Or at least search on the forum. Quite similar thread are there, you can find in our forum.
Then what? Try to explain your question more clearly, some people can be confused.Quote:
Originally Posted by karq
My app is like a sticky note, where you can add notes. Right now I'm trying to build a web extension. I dont have my laptop allways with me, so I'm building a web extension so that I can add things to the list with my mobile phone.
The app should send/receive note files from the server.
If you want you can get my first build from here http://karq.planet.ee/blog/wp-conten...nload.php?id=1
Why does your code try to access the SystemTray? I tried to run it with some security and I get: access denied (java.awt.AWTPermission accessSystemTray)
Also it says: Can't read input file!
I ran it with some security to limit its actions.
What permissions does it need to execute?
Fine, I can see in the my tray and I have an idea what you want to do. But my concern is that why you want to upload/download to/from the server. If I'm right you just want to access the task.do file to keep records of the items (task actually). So to do that uploading/downloading the file is not a good choice at all. Just implement a web service to process the data on that file, keep the file in the server (not in the local machine as your example does) and in both desktop and mobile application access that file. Web service can be use in two cases.
Okay, in simple terms without a connection to the WAN (actually the internet) how can you connect two devices? You can't. In that sense you've to maintained two application separately, and at the beginning you have to sync your data file. Still you need a connection to the internet, but no need to be both devices connect to that WAN.
Most of the time I will have connection, but if I dont I then I would like to have the most recent list avaliable on my pc. Basiclly I still have to download the file on my pc.
My advice is not to download the file, to sync the file only download the content to the local device, just the content. Through a webservice as a XML stream, much safer much effective.
So basically I have to replace my task.do file with a xml file and then make a stream from the server to my local machine?
I made some research on web services, tell me if i'm wrong, but if I implement a web service to the project, then it will run on tomcat, so if I export the project into a runnable jar, will the web service still work if I dont have tomcat installed and the task file is just on a apache web server?
I dont have much knowledge about servlets, tomcat and how they work. Example: If I upload a php project to a apache web server, then it will work there, but if I upload a java EE(jsp, servlets) project then it propably will not work(javaEE project need tomcat for running?!!?!)?
Web service should run in the server, so that you've use kind of web server like tomcat, etc. Without that how you can deploy it, just think that web-service also kind of web site, but the different is you are heavily use it o transfer the data. It dosen't matter that your project is J2EE, J2SE, etc... Each has quite similar technologies, means that underlying concept is not differ at all. You can use webservice from your mobile application, desktop application, etc.
And also for transfer data I didn't told that XML is the ONLY solution. It's one of the best technology to use, secure and reliable. You can define your own protocols and pass data in different formats too.
Maybe someone can give me some good web service tutorial links?
Why don't you search on the web bout it, until wait for someone.