【发布时间】:2014-05-15 17:35:56
【问题描述】:
出于某种原因,ie9 不会向服务器上传任何内容,也不会触发失败、成功或完成回调。这是我的代码:
HTML:
<label class="profile-image-container btn-act-green" id="fileupload" data-url="{% url 'festival_registration_file_upload' uidb36 token %}" for="id_image_upload">
<input type="file" name="image_upload[image_upload]" id="id_image_upload" accept="image/*" multiple>
</label>
js:
$(this).find('input[type="file"]').fileupload({
url: $el_root.attr('data-url'),
forceIframeTransport: true,
autoUpload: true,
dataType: 'json',
add: function(e, data) {
data.submit();
},
fail: function(e,data) {
alert('fail')
},
success: function(e, data) {
alert('success')
},
done: function(e, data) {
$progress_bar.css('width', '0%');
$el_root.addClass('image-uplaoded').removeClass("error");
$('#id_profile_image').val(data.result.fields.image_upload);
$image_tag.attr({
'src': data.result.image_url,
'width': image_width,
'height': image_height,
'position': 'absolute'
}).css({
'top': 0,
'left': 0
});
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('.progress-bar').css(
'width',
progress + '%'
);
}
})
有人发现问题了吗?
我在虚拟机上测试:win7和ie9
【问题讨论】:
-
我知道文件加载,因为如果我将警报('add')放在添加函数中,它会向我显示警报框。控制台没有错误
-
嗨乔纳斯,你能解决这个问题吗?您在一年多前发布。如果是这样,你能记得你做了什么吗?
-
对不起,不,已经过了太多时间。
标签: jquery file-upload internet-explorer-9