I have checked online including this web site and have been unable to find a solution to my problem.
I am trying to us the JQuery File Upload plugin and have made some amendments to restrict the files types to CSV and XML, as well as restricting to 1 file only and up to 5MB per file. These new properties work fine and it also works fine in all browsers except IE.
I have bound an event on the fileupload event that will render the CSV as a HTML table. This works fine in all browsers except IE. In IE, it either throws an error or freezes with the green progress bar at the top right displaying the following information:
7.123775601068567 bit/s | 00:00:00 | 100.00 % | 0.00 KB / 0.00 KB
It actually looks like it is hanging as it does not seem to complete the upload. And when I reload the same page it shows the correct display! without the progress bar!
UPDATE: The code is fine when I simply upload the CSV file. Now the problem appears when I attempt to include a callback option. It seems related to the 'fileuploadcompleted' event, which I updated from 'fileuploaddone', which has improved the result but still not right and does not execute and render the HTML table at all (See link above for example)
// Load existing files:
$('#fileupload').each(function () {
var that = this;
$.getJSON(this.action, function (result) {
if (result && result.length) {
$(that).fileupload('option', 'done')
.call(that, null, {result: result});
}
});
}).bind('fileuploadcompleted', function (e, data) {
//console.log('fileuploaddone:start');
var $filename = $('#fileupload td.name').text().trim();
//console.log('filename is ' + $filename);
$.get('../jQuery-File-Upload/server/php/files/' + $filename, function(data) {
$('#CSVSource').html('<pre>' + data + '</pre>');
});
$('#CSVTable').CSVToTable('../jQuery-File-Upload/server/php/files/' + $filename,{
loadingImage: 'img/loading-table.gif',
startLine: 0 }).bind("loadComplete",function() {//for future use});
}).bind('fileuploaddestroy', function (e, data) {
//console.log('fileuploaddestroy');
$('div#CSVTable').fadeOut(1000);
});
Any ideas how to get this working in IE?
Many thanks.