Misha Moroshko
Misha Moroshko

Reputation: 171489

How to load file into javascript

I have an HTML table that should be updated according the file that user uploads. In other words, I would like user to be able to upload a file, and change the contents of the table according to file content. The file size can be several MB. What are my options ? Do I must to upload the file to a server, or it can be done in client side ? Thanks !

Upvotes: 0

Views: 537

Answers (3)

nickf
nickf

Reputation: 546503

The only way you could do this would be to upload the file to the server, process the file there and then return a set of values which need to be inserted into your page.

Upvotes: 0

Vishal Seth
Vishal Seth

Reputation: 5048

You can upload the file in pre-determined XML format and then bind HTML table to XML data island.

See this example: http://www.users.cloud9.net/~bradmcc/xmlisland.html

Although, I'm not sure if this technique works with Chrome.

Upvotes: 0

Fyodor Soikin
Fyodor Soikin

Reputation: 80915

No, you cannot manipulate files on the client side. Unless you convince the user to turn off security for your application.

Upvotes: 1

Related Questions