DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Ftp

  1. #1
    Join Date
    Oct 2004

    Question 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
    What type of softwares do you like and what would you pay for it?


  2. #2
    Join Date
    Mar 2006
    Currently I'm using Jakarta Commons Net library, which includes FTP package . It supports quite full functions to write a FTP program, even create, delete file or dir...better than Sun's implementation. You should check out here :
    http://jakarta.apache.org/commons/net/ --> for download
    and options:

  3. #3
    Join Date
    Mar 2004
    You'll need to write protocol for handling FTP and understand the commands the protocol uses. I *think* its similar to using a Telnet protocol, but I'm not positive. You're probably much better off using a 3rd party package.

    If you really want to write your own protocol handler, read through this:

Similar Threads

  1. URGENT: FTP Client / Server using RMI
    By lwinn213 in forum Java
    Replies: 2
    Last Post: 10-23-2008, 01:14 PM
  2. FTP File Exists
    By chrispl in forum VB Classic
    Replies: 3
    Last Post: 06-25-2006, 07:39 AM
  3. Replies: 2
    Last Post: 03-21-2006, 10:35 PM
  4. FTP Link on Web Page
    By William Kochevar in forum Web
    Replies: 0
    Last Post: 10-18-2001, 01:05 PM
  5. How do I detect an FTP timeout?
    By Julian Milano in forum VB Classic
    Replies: 2
    Last Post: 08-11-2000, 12:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.