top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

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

+1 vote
1,580 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 Google+ Share Button LinkedIn Share Button Multiple Social 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 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?

+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

+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

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...