This works in the latest version of Chrome and Firefox, however in IE10 I get this error:
SCRIPT5: Access is denied.
Here is my code snippet:
$('.mlsUpload').change(function () {
var formData = new FormData($(this).parents('form')[0]);
});
It happens on the new FormData($(this).parents('form')[0])
The change is on a display:none input type=file, which is the only thing in the form.
I'm not entirely sure on why but this code seems to have fixed the issue and works on all browsers.
var formData = new FormData();
var inputFiles = $("#idOfInput").get(0);
formData.append('file', inputFiles.files[0]);
IE10 restrict submission of file field if the field is with 'display:node'. If you remove the display:none the first fragment of code should work. However I'm not sure how to workaround this and why it works in second example.
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