I want help to Send a File to a Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AtulTiwari
    New Member
    • May 2007
    • 23

    I want help to Send a File to a Server

    I m very new to Client/Server Programming and wants a help from u all that if any one can help me to share some Code that how can we send Files from one PC to another.
    Thanks in Advance.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by AtulTiwari
    I m very new to Client/Server Programming and wants a help from u all that if any one can help me to share some Code that how can we send Files from one PC to another.
    Thanks in Advance.
    You have to implement some protocol: suppose you want to send a file to me.
    I have to store it somewhere on a disk, so at least you have to send me the
    name of the file; preferably before you're sending the contents of that file. If you
    want to help me a bit you'll send the number of bytes I'm expected to receive.
    Then you send me the content (the bytes) of the file. I can take care of the rest
    then. This is just a very primitive protocol that doesn't know how to handle
    errors of any form, but it's a start.

    kind regards,

    Jos

    Comment

    • AtulTiwari
      New Member
      • May 2007
      • 23

      #3
      Wants a help, in Sending A file To Remote PC

      Hi to all ,
      Actually I m New To Java IO and Unable to make a programme for sending a file to Remote pc from my machine.
      So plz give me some Suggestion that how can i do the same.

      Comment

      • AtulTiwari
        New Member
        • May 2007
        • 23

        #4
        Originally posted by JosAH
        You have to implement some protocol: suppose you want to send a file to me.
        I have to store it somewhere on a disk, so at least you have to send me the
        name of the file; preferably before you're sending the contents of that file. If you
        want to help me a bit you'll send the number of bytes I'm expected to receive.
        Then you send me the content (the bytes) of the file. I can take care of the rest
        then. This is just a very primitive protocol that doesn't know how to handle
        errors of any form, but it's a start.

        kind regards,

        Jos
        Thanks Dear For ur Reply,

        But which Method or which Class i can use To send The File?
        For Example as i know about all these is that
        May i have to Use Datagram to send the File? or something Else?
        By which method i can send the Name of the file over network? or by which method i can send the Data?

        And how will u Recieve the Data and file Name on your Side bcz i have to code for Server Also

        Comment

        • r035198x
          MVP
          • Sep 2006
          • 13225

          #5
          Originally posted by AtulTiwari
          Thanks Dear For ur Reply,

          But which Method or which Class i can use To send The File?
          For Example as i know about all these is that
          May i have to Use Datagram to send the File? or something Else?
          By which method i can send the Name of the file over network? or by which method i can send the Data?

          And how will u Recieve the Data and file Name on your Side bcz i have to code for Server Also
          Here is an old FAQ on Java network programming. It might help clear out some issues for you and may give you a start.

          Comment

          Working...