4
rated 0 times
[
6]
[
2]
/ answers: 1 / hits: 10721
/ 10 Years ago, fri, september 5, 2014, 12:00:00
I have an <input type=file>
with a local file selected, which I would like to upload to the server as a File, not as a Blob. I'm grabbing it with jQuery (element and then .files[0]
or .prop('files')[0]
).
By every indication but one, the prototype of this object is File:
Object.getPrototypeOf(file) // => File {slice: function}
file.__proto__ // => File {slice: function}
file.constructor // => function File() { [native code] }
file.constructor.prototype // => File {slice: function}
And yet:
file instanceof File // => false
file instanceof Blob // => true
What gives?
More From » file