views:

212

answers:

2

Is there a file upload control for ASP.Net which performs a client-side checksum calculation (CRC, MD5, etc) on the file contents and transmits the checksum to allow for server-side checksum validation?

I have looked through answers on several file upload questions, but did not find this feature mentioned anywhere.

A: 

You'll need some client code to open your file, compute that check sum and to post it to your webserver with your file content; you can't do that with plain javascript, as you're not supposed to have access to your user filesystem.

But, just like @Dan Herbert commented out into your question, to use a client application like Flash, Java applet or Silverlight to execute that. I just wanted to make a more complete answer and to explain why you can't do that.

Rubens Farias
A: 

From javascript you won't be able to detect the size of a file in the client computer. Javascript runs inside a sandbox and cannot access local system files, which will be a ecurity violation.

You can use silverlight and can get the file size and calculate the sum. You can check this

Silverlight File Uplaod

rahul
When I asked the question, I had no idea how Flash handles uploads. It seems you cannot get access to the file stream being sent. So Silverlight would currently be the only possible solution I guess (apart from client software that needs to be installed separately)
devio