Simplest way of reading a file from clients computer?
i need to read a txt file from clients 开发者_StackOverflowand then send it to my server in a form input? What is the simplest way to achieve this? Also i don't want to send it as a file, i want to send it as a string in an input box.
The simplest way is to send it as an uploaded file. However, this does not require you to save the stream of bytes into a file on your server. You can process it directly in your serverside application.
There aren't any mature APIs for reading files right now across all browsers, however if you use webkit-based browsers or Firefox there are options.
Here's a tutorial: http://www.html5rocks.com/tutorials/file/dndfiles/
精彩评论