Can anybody give some sample code to read and write a file using JavaScript?
The future is here! The proposals are closer to completion, no more ActiveX or flash or java. Now we can use:
File System APIs
Native Drag&Drop File Access
You could use the Drag/Drop to get the file into the browser, or a simple upload control. Once the user has selected a file, you can read it w/ Javascript: http://www.html5rocks.com/en/tutorials/file/dndfiles/