I have an ASP.NET MVC app. This app requires jQuery 2.1 due to other jquery plugins in the app. I am trying to provide a way for my user's to upload pictures. In an attempt to do that, I was looking at the jQuery file uploader. My JavaScript looks like this:
$('#userPicture').fileupload({
dataType: 'json',
done: function (e, data) {
}
});
The userPicture markup looks like this:
<input id="userPicture" type="file" name="userPicture" data-url="/pictures/User/@ViewBag.UserId">
The page initially loads without any errors. When I choose a picture though, I get an error that says:
Uncaught Error: no such method 'process' for fileupload widget instance jquery-2.1.1.js:250
No image preview is shown. How can I choose a picture and show a client-side preview via a JQuery plugin that works in IE 8+
I made a complete javascript function using jquery and ajax to upload files ... Everything is working perfectly untill I realized that for some files the error function is fired in ajax instead of success function.
For anyone getting the "Empty file upload result" error when uploading images, make sure that you have the gd-extension for php installed. Sorry, something went wrong. great one... Sorry, something went wrong. I'm sorry, but what do you mean by the reply wasn't an array?
If the user tries to upload a file of more than 300kb, the submit button will be disabled. And if the file uploads less than 300kb then the submit button will be activated. so first create a simple form using plain HTML.
You must to change the upload_max_filesize, post_max_size, max_execution_time and max_input_time in php.ini settings to fit your need. Changing these settings correctly will allow you to increase or decrease the size of the files uploaded and avoid the ""Empty file upload result".
I had the same issue with Chrome, in my case the problem seem to be is missing jquery plugin "jquery.fileupload-process.js" as @jevgenig mentioned in his comments. hope this could help someone
From the specs I checked, jQuery 2.x supports IE9+.
Source: http://jquery.com/browser-support/
So jQuery 2.1 doesn't support IE8.
If you're using the jQuery plugin you mentioned, there's very few support for IE9-:
If you're supporting modern browsers (Firefox, Chrome, IE10+):
Here's the full list:
https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support
You're problem is most probably related to the jQuery 2.1 support for IE8.
Possible solutions:
1- use an older jQuery version. You can use any jQuery 1.6+ with the jQuery File Upload plugin (Source: https://github.com/blueimp/jQuery-File-Upload). jQuery 1.x has support for IE6+, so it supports IE8.
2- (RECOMMENDED) get rid of IE8. Upgrade your jQuery version to the latest stable version. Use the latest version of the jQuery File Upload plugin. Provide a simple HTML upload for the IE8 users.
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