Forums Register Login

copying files over a network

+Pie Number of slices to send: Send
how do i copy files over a network using a socket? I have something written but I hard-code the file size.
+Pie Number of slices to send: Send
 

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
+Pie Number of slices to send: Send
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:
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3967 times.
Similar Threads
Sending 1GB files over the network
java network apis
Read and Write Files on a Network
CRC in java
how to get list of files of another machine over a network
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:03:24.