$("#fileuploader).fileupload({ //dataType: 'json', autoUpload: true, acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i, maxNumberOfFiles : 1, url:ctx+'url', add: function (e, data) { data.submit(); //this will 'force' the submit in IE < 10 }, progressall: function (e, data) { //进度条 var progress = parseInt(data.loaded / data.total * 100, 10); $('#progress .bar').css( 'width', progress + '%' ); }, done:function(e,result){ //完成后进行的操作 }, fail: function(e, data) { //错误提示 alert('Fail!'); } });