How can i run code on the client side from a browser?

320 Views Asked by At

With LLVM and silverlight this may be possible now (or it may be possible with flash).

I like the user to select a file and then do the following things 1) Hash it with md5 and sha1 2) If archive check if an exe is in it 3) If archive check if password protected

The first to see if the user has uploaded it already (today, yesterday, last month) 2nd to prevent viruses 3rd i should be fine without but if i decide to not allow protected archives i can warn before the user uploads it.

How may i do this through the browser?

2

There are 2 best solutions below

2
On BEST ANSWER

You can do this across lots of platforms with Java or Flash.

If you only care about doing it on Windows you can do it with those 2 or Silverlight, an embedded WPF page, an embedded Windows Forms page or an ActiveX control.

3
On

You can use the in-progress HTML 5 File API. Look at FileReader.readAsBinaryString in particular. However, I would consider it a waste of time in this case. You would have to redo all these checks on the server anyway (never trust the client).