Reputation: 2367
i need to read a txt file from clients and 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.
Upvotes: 0
Views: 105
Reputation: 32392
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.
Upvotes: 1
Reputation: 2166
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/
Upvotes: 1