Results 1 to 2 of 2
  1. #1
    user12345 is offline Member
    Join Date
    Mar 2009
    Posts
    1
    Rep Power
    0

    Question How to use FTP to read files from server?

    Hi All,

    This is my first ever post in Java forums. I am very new to Java.

    My requirement is load data using sql*loader through Java taking files from the local machine. Now my requirement is to take the data files from the FTP server.

    It may be a silly question, but I really do not have any idea how to read the files from FTP server.

    Can someone help me with this issue?

    Thanks in advance.

  2. #2
    logicbug's Avatar
    logicbug is offline Member
    Join Date
    Jan 2009
    Location
    The Great White North, eh?
    Posts
    76
    Rep Power
    0

    Default

    This should get you started

    Java Code:
    URL url = new URL("ftp://user01:pass1234@ftp.foo.com/README.txt;type=i");
    URLConnection urlc = url.openConnection();
    InputStream is = urlc.getInputStream(); // To download
    OutputStream os = urlc.getOutputStream(); // To upload

Similar Threads

  1. Read and Open *.txt Files? help!!
    By ashton in forum New To Java
    Replies: 9
    Last Post: 11-01-2009, 03:42 PM
  2. How Read and Write XMl files using Java
    By tjs in forum SWT / JFace
    Replies: 0
    Last Post: 02-23-2009, 12:19 PM
  3. Replies: 2
    Last Post: 02-20-2009, 07:13 AM
  4. Saved files are coming back as read-only
    By Manoeuvre in forum Eclipse
    Replies: 0
    Last Post: 11-21-2008, 05:18 PM
  5. [SOLVED] Read/write files using applets
    By coolFrenzi in forum Advanced Java
    Replies: 3
    Last Post: 11-17-2008, 10:45 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
  •