File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

copying files over a network

 
J Mangual
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how do i copy files over a network using a socket? I have something written but I hard-code the file size.
 
Henry Wong
author
Marshal
Pie
Posts: 20836
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J Mangual wrote:how do i copy files over a network using a socket? I have something written but I hard-code the file size.


Well, you will need to design a protocol between the two sides -- maybe the sender can send the filename and filesize, prior to sending the bytes of the file.

Henry
 
J Mangual
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is some sample code I found while searching. Is there a way to transfer files which does not depend on the file size?

The Server:

The Client:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic