Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript file upload

In most browsers, an input type="file" has the following files property:

document.getElementById("my-input").files

This can be used to detect a file is uploaded, and get the file. However, it looks like the files attribute doesn't exist in IE9.

Added:

In jQuery, you can do...

$("#my-input").val() to read the file name. What about getting the files contents?

like image 881
Jeff Avatar asked May 31 '11 18:05

Jeff


1 Answers

Use jQuery and this plugin.

like image 167
Rodrigo Avatar answered Sep 20 '22 03:09

Rodrigo