Hi all,
I've done the upload system with recovery with a VB6 client and a c# Webservice.
The client begin by ask to the server the file infos (size and MD5). Then,he was able to read the local file from the begin to the server file size and calculate the MD5 to compare and determine if he could continu the upload or if he must re download from the begin.
To calculate a MD5 checksum file part in VB6, I found a DLL with three methods:
Init, Update and Finish. I could read the file in a buffer and stop at the correct position and retreive the MD5 witch was the same than the MD5server file that was not finish.
The system works perfectly.
I'm trying to make the same system, butfor download. In this system, it is the server witch must compute the MD5 checksum of his file from the begin to the client position to determine if the client can continu or re download from the begin.
But in C#, the file part MD5 is not the same that the local file MD5. I read the server file, I push the correct size of data in a MemoryStream, and I calculate the MD5 from it that differs with the local MD5. To test, in the same time I build the MemoryStream, I build a FileStream in the same way thatI reload and calcul the checksum and then, it is the correct data, with correct MD5 checksum.
So, how can I calculate the MD5of file data from the begin to a specified position?
Thanks very much,
Aurélien