Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 15 of 15

Thread: FTP protocol implementation

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default FTP protocol implementation

    Hi people!

    I have to write a code for File Transfer Protocol! It says that I only need to write code for client, but it also says that I have
    to run the program and send some files to server. I guess than I also need server side as well. I have to write my own classes, I cann't import some existing classes. I have to connect to the server with password and username and after that send some files to the server. I don't know anything about FTP. Can i maybe do this by Sockets and ports? I worked something with that.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: FTP protocol implementation

    I assume that the server handles the FTP protocol. The client code that you're to write would use sockets with ports.

    google for the RFC doc about the FTP protocol.

    Also posted at http://forums.devshed.com/java-help-...ml#post2864533
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Mar 2013
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: FTP protocol implementation

    Norm thanks for help, but I still have problems.
    Guys, is there anybody to know something about this. When I try to find on google how to write your own code for FTPClient I always find advices to use some already existing classes like appache FTP server, but it does'n help me. It is really important, so if anybody can give me some advice I would appreciate it very much. Is there some source code for that appache FTP server to see how it is done? I know how to connect on server using sockets. I have Filezilla on my computer and I run my FTPClient aplication and it connects on FileZilla server. Now I have to login with username and password and send some files on server.

    I will also post this on another site

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: FTP protocol implementation

    Did you read the RFC on FTP? It explains how the protocol works.
    Basically you use sockets to send and receive FTP statements with an FTP server.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Mar 2013
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: FTP protocol implementation

    I read it,but again I don't know to do it. I will read it again and try do understand it good...

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: FTP protocol implementation

    The RFC gives you the commands that you need to send to the server and the responses that the server will make: the protocol.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Mar 2013
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: FTP protocol implementation

    afet conection to the server I have to send him user and then password, it says in protocol but I dont know how to send it.
    in java maybe something like this?
    OutputStream os=socket.getOutputStream();
    OutputStreamWriter osw=new OutputStreamWriter (os);
    PrintWriter pw=new PrintWriter (osw, true);
    pw.writeLine("user", "USER1");

    --- Update ---

    I did it

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: FTP protocol implementation

    I did it
    What response did you get?
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Junior Member
    Join Date
    Mar 2013
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: FTP protocol implementation

    220-FileZilla Server version 0.9.41 beta
    220 Welcome!
    user User1
    331 Password required for user1
    pass lijepdan
    230 Logged on

  10. #10
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: FTP protocol implementation

    Looks like you are making progress.
    If you don't understand my answer, don't ignore it, ask a question.

  11. #11
    Junior Member
    Join Date
    Mar 2013
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: FTP protocol implementation

    I finished my FTP Client application!!!!!!!!
    THANKS NORM!! I keep runing into you everywhere.
    You will find this post on some more places!!!!

  12. #12
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: FTP protocol implementation

    Please post links to the other sites where you have posted questions.
    If you don't understand my answer, don't ignore it, ask a question.

  13. #13

  14. #14
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: FTP protocol implementation

    If you don't understand my answer, don't ignore it, ask a question.

  15. #15
    Junior Member
    Join Date
    Apr 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: FTP protocol implementation

    Hi,
    I need ti make e client ftp, Please can you send me your code to begin?
    Thnks

Similar Threads

  1. Replies: 0
    Last Post: March 27th, 2012, 08:00 AM
  2. Scanning large FTP directories with apache.commons.net.ftp
    By daniel_el in forum Java Theory & Questions
    Replies: 3
    Last Post: February 10th, 2012, 06:40 AM
  3. simple ftp server and ftp client
    By simontkk2005 in forum Java Networking
    Replies: 4
    Last Post: January 26th, 2011, 10:29 AM
  4. communication protocol
    By isaac in forum Java Networking
    Replies: 1
    Last Post: February 5th, 2010, 08:20 AM
  5. Exception (payword protocol)
    By ThodorisVon in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 27th, 2010, 01:35 PM