Results 1 to 2 of 2
  1. #1
    jairoh_ is offline Member
    Join Date
    Feb 2012
    Rep Power

    Default Sending files, images into streams.

    Good day everyone, I made a chat program using socket but i don't wanna be limited w/ just sending messages. I wan't to include file. how is it possible? is there anyone can give some idea? tnx

  2. #2
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Rep Power

    Default Re: Sending files, images into streams.

    Well where are you stuck? There isn't much difference between sending a text message or sending binary data over a socket; the difficulty is in knowing when the transfer of bytes is finished. A trick I use is to first send a text message with the number of bytes in the file, which the receiving end can use to know when the entire file is read from the socket.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Sending files
    By Pojahn_M in forum Networking
    Replies: 11
    Last Post: 02-19-2012, 02:39 AM
  2. Server Sockets sending images from URL
    By devett in forum Networking
    Replies: 1
    Last Post: 06-07-2011, 07:25 AM
  3. Replies: 23
    Last Post: 08-12-2010, 09:59 AM
  4. sending and recieving files
    By rav in forum New To Java
    Replies: 9
    Last Post: 07-26-2010, 04:34 PM
  5. problem in socket connection in sending images
    By vibhor in forum Networking
    Replies: 2
    Last Post: 02-20-2009, 05:39 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