From the client side, how do i send a file? I mean, how do i go about breaking the file down after sending it's info to the server side? I know the server has to recive the file size and name to createfile. So how do i send the bytes for the file to the server? Is there a "SendFileByte" winsock api that i just don't know about??? I wish it was that easy. If anyone knows how, has code, or just knows a good alg. Let me know :) Thanks! Nok.
Posted on 2001-04-27 12:48:00 by Nokturnal
You have to understand that winsock is the conduit for data transfer: it generally doesn't care about the meaning of the data itself. It's entirely up to the user to interpret the data. So in your situation, you may think up a simple protocol such as: - the first four bytes are the signature that signifies the start of transfer,eg. "MIST" -following the signature may be the length of filename -Next, the filename string -Next dword may be the file size -The data that follow will be the data in the file
Posted on 2001-04-27 20:43:00 by Iczelion
In WinSock 2 there's the TransmitFile API, but not everyone has WinSock 2. So, you're a bit stuck there. You might out Cinchy server at Iczilions site, it transmits a file using the default WinSock 1.x API.
Posted on 2001-04-28 06:14:00 by Qweerdy