While there are JS implementations of the MD5 algorithm, older browsers are generally unable to read files from the local filesystem.
I wrote that in 2009. So what about new browsers?
With a browser that supports the FileAPI, you can read the contents of a file – the user has to have selected it, either with an <input>
element or drag-and-drop. As of Jan 2013, here’s how the major browsers stack up:
- FF 3.6 supports FileReader, FF4 supports even more file based functionality
- Chrome has supported the FileAPI since version 7.0.517.41
- Internet Explorer 10 has partial FileAPI support
- Opera 11.10 has partial support for FileAPI
- Safari – I couldn’t find a good official source for this, but this site suggests partial support from 5.1, full support for 6.0. Another article reports some inconsistencies with the older Safari versions
How?
See the answer below by Benny Neugebauer which uses the MD5 function of CryptoJS