QUOTE(silverblaze @ 23 May, 2008 - 10:37 AM)

Hello all,
I am currently working on a file hosting site. I like to ad a file verification system into it.
What exactly i want to do is, After uploading a file i have to verify whether the uploaded file has some errors while uploading. i mean wheather the file got corupted while uploading. In other words i want to check the uploaded file against the orginal file.
Is their any way to do it?
I am uploading the file with CGI and the file will be in the default temp dir and from their i will move it to the files dir using php. If their is a way to verify whr is the best place to do it, while the files are at temp dir or after moving it to the files dir?
Thankyou,
Regards,
Anush.
Hello again,
Read up on how to to do checksums. Checksums are basically a way to verify the integrity of data, and especially files. You'll see that most sites that offer file downloads have a checksum that can be used to verify the integrity. I'm not going to go into crazy details because there is way too much to go over, but you can start by reading
this tutorial. All you need to do is adapt everything to php. You could also try googling 'php checksum' and see what comes up.
Hope all that helps. Take care.