Results 1 to 4 of 4
  1. #1
    Zucheto is offline Member
    Join Date
    Feb 2008
    Rep Power

    Default Coding an FTP server in java

    Hi, im new to Java and am in the beginning stages of socket programming. I am trying to build a simple file transfer protocol that can support the reliable transfer of files of at least 1 mb in size. I can set up a client and server connection to send strings back in forth but I'm not for sure how to code it to where I can actually pull files off my computer to send to the server. Is there anyone who could give me an example of how to actually send real files and not just strings? Would be greatly appreciated. THANKS

  2. #2
    redmoonzer01 is offline Member
    Join Date
    Mar 2008
    Rep Power


    to send a file ...

    server side=
    create InputStream to the file to send
    read in bytes to byte array
    send byte array

    client side=
    create file
    create outputstream to that file
    write the bytes from byte array that you received to that file

  3. #3
    vglass is offline Member
    Join Date
    Jul 2007
    Rep Power


    If you are going to write an FTP server I would recommend starting with reading the RFC 959 which describes the protocol itself.

  4. #4
    fishtoprecords's Avatar
    fishtoprecords is offline Senior Member
    Join Date
    Jun 2008
    Rep Power


    Do you mean implement the FTP as specified in the RFCs? Or just a file protocol?

    Do you need to handle big endian and little endian transfers? Machine that don't use 8 bit bytes?

    To do it in general is fairly difficult, getting through firewalls, etc. But for an assignment, you can simplify the requirements.

Similar Threads

  1. Help On Coding problem
    By mandrake446 in forum New To Java
    Replies: 3
    Last Post: 12-08-2007, 08:01 AM
  2. Error in my coding
    By one198 in forum New To Java
    Replies: 2
    Last Post: 10-13-2007, 05:07 AM
  3. Cannot solve the coding problem of my assignment
    By elimmom in forum New To Java
    Replies: 3
    Last Post: 08-13-2007, 11:33 AM
  4. Problem in my coding
    By one198 in forum New To Java
    Replies: 9
    Last Post: 08-09-2007, 10:07 AM
  5. Help with program coding
    By cachi in forum AWT / Swing
    Replies: 1
    Last Post: 07-31-2007, 07:16 AM

Posting Permissions

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