×

Discussion Board

Results 1 to 5 of 5

Thread: FTP

  1. #1
    Regular Contributor
    Join Date
    Dec 2009
    Posts
    77

    FTP

    How to send files using FTP in j2me and blackberry .Please any one guide me.

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: FTP

    Quote Originally Posted by suneethapuchakayala View Post
    How to send files using FTP in j2me and blackberry .Please any one guide me.
    AFAIK, File Transfer Protocol (FTP ) is not directly supported by Java ME. Hence if you want to work on FTP then you would need to customize your own FTP implementation on top of a Socket connection.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Regular Contributor
    Join Date
    Dec 2009
    Posts
    77

    Re: FTP

    can we use any 3rd Party libraries for FTP???????????
    I used org.apache.commons.net.ftp.FTPClient this package ;
    public void FTPSample()
    {
    try{
    FTPClient client = new FTPClient();
    InputStream is = null;

    client.connect(path");
    client.login(username, password);

    String filename = "logo1.png";
    is = getClass().getResourceAsStream(filename);
    //fis = new FileInputStream(filename);
    client.storeFile(filename, is);
    client.logout();
    is.close();
    }catch(Exception e){e.printStackTrace();}
    }

    But the error im getting is class file for java.net.InetAddress not found
    I dont want to use socket connection.plz give me the solution

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: FTP

    Quote Originally Posted by suneethapuchakayala View Post
    can we use any 3rd Party libraries for FTP???????????
    I used org.apache.commons.net.ftp.FTPClient this package ;
    public void FTPSample()
    {
    try{
    FTPClient client = new FTPClient();
    InputStream is = null;

    client.connect(path");
    client.login(username, password);

    String filename = "logo1.png";
    is = getClass().getResourceAsStream(filename);
    //fis = new FileInputStream(filename);
    client.storeFile(filename, is);
    client.logout();
    is.close();
    }catch(Exception e){e.printStackTrace();}
    }

    But the error im getting is class file for java.net.InetAddress not found
    I dont want to use socket connection.plz give me the solution
    As I told you that the FTP is not supported by the Java ME and hence I wonder if this can work. Nothing can be done if the particular protocol is not supported by the technology and platform.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: FTP

    i haven't heard of a java me compatible ftp library, but if you are only trying to store files, you probably can do a partial implmeentation with a socket connection. basically, an ftp put is quit easy, it's something like open a socket, read the message of the day, write your login and password to it (USER user, read 3, PASS password, read 3, ACCT, read 2), write store, write the name of the file, and write your file, then read the answer, which should start with a 2 (check some basic implementation and ftp specifications for example)

Similar Threads

  1. FTP using Sockets
    By David_Fisher in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2010-11-18, 13:16
  2. FTP progress
    By ianw in forum Symbian
    Replies: 7
    Last Post: 2008-10-05, 23:48
  3. FTP in J2ME
    By amalshah73 in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2008-07-14, 17:42
  4. ftp client
    By acar3 in forum Symbian
    Replies: 0
    Last Post: 2004-09-10, 10:59
  5. Ftp
    By kaumudi in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2003-05-10, 12:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×