FTP

F

freesoft_2000

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:p[email protected]/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
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

freesoft_2000 said:
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:p[email protected]/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?

http://jakarta.apache.org/commons/net/ has flexible FTPClient.

Arne
 
T

Tor Iver Wilhelmsen

freesoft_2000 said:
URL url = new URL("ftp://user01:p[email protected]/README.txt;type=i");
URLConnection urlc = url.openConnection();
OutputStream os = urlc.getOutputStream(); // To upload

The "builtin" FTP protocol handler is just for retrieval. You need a
proper FTP library to actually do FTP client actions like upload and
the like.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top