before i start with this i like to ask if im right.

to tranfer a file i need to send to the server the name and the size of the file.
then i can open the file on my system and read the content in the buffer.
this buffer i send to the server ,like i send text messages.
the server creates a new file with the name i send and fill it from the recieved buffer.
last i check the filesize ,if size ok = transfer successful

is this way correct ?
sounds to easy for me and im shure i miss something :-)

Posted on 2002-01-16 06:24:01 by Max
Once the server has received the file name it should try and create it (because it may fail) and then send a an "OK", or a "FAIL" message.
When the client has sent the file name it should wait for the "OK" or "fail" message if it is "ok" then you start to send if it is "fail" then you should display an error message.
What the "ok" and "fail" messages are is up to you ,you could just use 0 for fail and 1 for ok but both sides must recognise the same messages (protocol and they mut be the same type (example BYTE).
When I do file transfers I usually send it in little chunks and have the server confirm it has received each chunk this means you can display a progress bar
Posted on 2002-01-16 08:29:35 by Quantum