top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How we can resolve fakepath issue in Google chrome and IE version 9+ while uploading file?

+1 vote
2,792 views
How we can resolve fakepath issue in Google chrome and IE version 9+ while uploading file?
posted Oct 9, 2015 by Amit Kumar Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

I believe this is a security feature i.e. one should not be able to read the original file path of a file input into a browser form. File input is for reading file contents only.

Now coming to how can we solve this answer is use FileReader's readAsDataURL something like following in JavaScript

document.getElementById("myUploadInput").addEventListener("change", function() {    
    var reader = new FileReader();
    reader.readAsDataURL(document.getElementById("myUploadInput").files[0]);
});

Or something very similar, I dont have the access to the code so only can make a guess...

answer Oct 9, 2015 by Salil Agrawal
Similar Questions
+3 votes

I am trying to upload files through html page in our Windows based server but I don't know how to take the files on remote server & save files there

+3 votes

I am trying to debug a javascript file, which is used in a .jsp file. When I debug the using F12 in IE10 I did not find that particular file in the debugger tool.

Can anybody please tell, why that particular file is not showing even it is present in project folder location?

+1 vote

i want to create a chrome extension. its have complex mathematical queries. so i need to use python as scripting language. help me to implement python script in google chrome addon

...