Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

copying files over the internet with sockets  RSS feed

 
J Mangual
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to write a program (client and server side) which takes a file name and sense the file via a socket connection to another address. For example, I might want to send a pdf file across a network. A google search gave quickly gave me a way of copying methods from one location to another on my own computer simply using InputStream and OutputStream. When trying to send files over the Net i quickly confused myself with all the different kinds of streams. Is it possible to write everything with output stream?
 
K. Tsang
Bartender
Posts: 3624
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to write everything with output stream?


I don't see why not. Serializing objects is what most people use to transfer data or files over the network using sockets. The problem may become the network cuts off during the transfer or the client can't get the whole file. So splitting the file into chunks of bytes is more appropriate.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!