Reputation: 106
I have code for preview image and get image name:
$("input[type=file]").on("change", function() {
$("[for=file]").html(this.files[0].name);
$("#preview").attr("src", URL.createObjectURL(this.files[0]));
})
However I want to get the local url of image. For example, the image I choose from D:/pic.jpg
and I want display this file path. How can I do that? Please help me.
Upvotes: 0
Views: 385
Reputation: 23768
No modern browser allow you to get the exact local path of a file. The information your are looking for is limited by the security policy of the browser.
Upvotes: 1