Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

FTP

Thread view: 
freesoft_2000 - 25 Nov 2006 17:46 GMT
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
Tor Iver Wilhelmsen - 25 Nov 2006 18:02 GMT
> URL url = new URL("ftp://user01:pass1234@ftp.foo.com/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.
Arne Vajhøj - 25 Nov 2006 18:15 GMT
>                    Currently i am trying to connect to a site using ftp
> using the below method to upload a file
[quoted text clipped - 9 lines]
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.