Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function readSingleFile(evt) {
- //Retrieve the first (and only!) File from the FileList object
- var f = evt.target.files[0];
- if (!f) {
- alert("Failed to load file");
- } else if (!file.type.match('text.*')) {
- alert(f.name + " is not a valid text file.);
- } else {
- var r = new FileReader();
- //proceed with read…
- }
- }
Add Comment
Please, Sign In to add comment