for just educational reasons I want to access a remote file from java. To be more specific I want to upload somewhere a file at a remote pc and then make a program in java where I open it and read its content.Is dropbox a good option? Can this be achieved programmaticaly ? My main question is is there any free server or something like this where I can upload the file?
-
well it all depends what you want to learn. If it's basics you're looking for then why not write it all yourself? A server that will accept connections and store/retrieve the files and a client for it? Dropbox has a Java API client dropbox.com/developers/documentation but the only thing you'll learn using it will be, well, dropbox Java API ;-)Mateusz Dymczyk– Mateusz Dymczyk2013-11-15 14:47:43 +00:00Commented Nov 15, 2013 at 14:47
-
Thx for your commment! I didn't new that there was dropbox API, i will have it in mind!JmRag– JmRag2013-11-15 23:23:52 +00:00Commented Nov 15, 2013 at 23:23
Add a comment
|
2 Answers
FTP (File Transfer Protocol) might be the simplest solution.
One of many FTP APIs in Java: Apache Commons-Net FTPClient
Comments
It is very difficult to code an FTP in Java, i would suggest FTPing it using FileZilla. You will need to have an open Server in the remote PC (configured to FTP, port 21/22) and from there you can enter the remote PC's IP address and open port into FileZilla (after the server is configured). From there you can just drag and drop the file. Let me know if this helps.
1 Comment
JmRag
First of all thanks for your answer but I want to do it by java,not by using an FTP program!