Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- self.xhr1=new XMLHttpRequest();
- xhr1.open("GET","http://127.0.0.1:120/path/to/file.txt");
- xhr1.responseType="arraybuffer";
- xhr1.onload=function(){
- self.fi1_=new File([xhr1.response],"file.txt",{"type":"text/plain"});
- gfile(0,fi1_);
- }
- xhr1.send();
- /*
- weakmap all input[type=file] elements to regualar arrays replaceing their FileList arrays
- change the FileList.prototype.item with defineGetter and replace inputElement.files with a regular js array
- of the files fetched with xhr1;
- make popup window for the open file dialog window? with location.href set to http://127.0.0.1:120/
- make xhr request each file selected and add xhr responses as File() objects to the files[] array.
- finnally, create and fire a "change" event on the file input htmlelement
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement