is there a way to get a file object using the directory full path of the file itself? this piece of code wont work:
var file1 = new File("D:\\path\\to\\file\\file.txt");
I need to get the file object since I have a function that has a file object as its parameter.
bryan
That would be very tragic if browsers could suddenly start accessing users' file systems without their permission.
I would suggest using <input type="file">
. This way the user chooses which file they will allow the browser to access.
I would suggest you to use: <input type="file" id="fileUpload">
and get the file name using
$('input[type=file]').change(function () {
console.log(this.files[0])
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With