Ftp
Hi everyone,
Currently i am trying to connect to a site using ftp using the below method to upload a file
URL url = new URL("ftp://user01:pass1234@ftp.foo.com/README.txt;type=i");
URLConnection urlc = url.openConnection();
OutputStream os = urlc.getOutputStream(); // To upload
Now my question is how from java can i create or delete a directory as well as create or delete a file using ftp?
Is there also a way i can just connect to a ftp site say ftp.foo.com without specifying the file name so that i can connect to the ftp site first, create a file first then go to that file?
Any help is greatly appreciated
Thank You
Yours Sincerely
Richard West
freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
Once you have a connection you can talk over it using the command set provided for that protocol.
So you'll have to write FTP commands to that connection, and read the answers.
The RFC can tell you what those commands are (and there are quite a lot), or you can scour the internet for an FTP library (which I know exists, though I don't have the URL for it).
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337