I'm in desperate need of a multiple file transfering system. So far no one has helped me, I've never even seen someone do it correct yet! Any help is greatfully accepted.
Printable View
I'm in desperate need of a multiple file transfering system. So far no one has helped me, I've never even seen someone do it correct yet! Any help is greatfully accepted.
Describe in more detail, please.
Z.
It will be a component which allows a user to send a file and receive a file. It will be created so that more than one download can be going at once (multiple), and also it can recieve more than one file at once.
You could probably do it by opening the file in binary mode, and reading a single Long from the file at a time, change it to a string. Append that string to the number of bytes read(so the result would look like "4234534536", where the first 4 means 4 bytes), and send that over a winsock connection. When the data is recieved, break the first number out, convert the rest into a Long, and write out the long in binary mode, using the number of bytes. That solves the single file transfer problem. For the multiple connection thing, just load a new winsock control on each computer and have them connect, and procede as above. Of course, you should send the file name as the first string, followed by the byte data.
Z.