我正面临图像上传功能的问题。我正在使用 plupload 通过 jQuery ui 模态对话框上传文件。Ii 在 Firefox 和 Chrome 上运行良好,但在 IE 浏览器上,它可以正确打开文件选择对话框,但文件没有上传。它也没有显示任何错误。
我正在使用以下代码:
var insert_image_dialogOpts = {
autoOpen: false,
modal: false,
resizable: true,
width: 650,
show: 'blind',
title: 'Insert Image'
};
jQ('#insertimagebox').dialog(insert_image_dialogOpts);
jQ('#insert_image_dialog').click(function() {
jQ('#insertimagebox').dialog('open');
return false;
});
uploadInsertImage = new plupload.Uploader({
runtimes: 'html5,flash,gears',
browse_button: 'insertImage',
container: 'uploadImage',
url: '/upload',
multipart_params: {
'fancy_upload': '1',
'insert_image': '1',
'action': 'doUpload',
'forum': forum,
'uid': uid,
'pid': pid,
'timestamps': timestamps
},
multi_selection: true,
flash_swf_url: '/tools/plupload.flash.swf',
silverlight_xap_url: '/tools/plupload.silverlight.xap',
filters: [{
title: "Image files",
extensions: "jpg,gif,jpeg,jpe,png"
}]
});
// General settings
uploadInsertImage.init();
// Event for each file added
uploadInsertImage.bind('FilesAdded', function(up, files) {
jQ.each(files, function(i, file) {
jQ('#imagesInserted').append('<li class="file" id="'+file.id+'" style="float:left;cursor:pointer;margin:0px;padding:0px;list-style-type:none;font-size:10px;"><span id="fileProgress" onclick="jQuery(this).html(\'\')"><span style="float:left;" id="' + file.id + '">' + file.name + '' + '</span><div id="' + file.id + 'progress" style="width:9em; margin-top:5px; height:.6em;float:left"></div><a id="attachCancel' + file.id + '" href="javascript:;" onClick="stopUpload(\'' + file.id + '\');">Cancel </a></span><br></li>');
jQ('#' + file.id + 'progress').progressbar({
value: files.percent
}).append('<div style="line-height:8px; text-align:center; font-size:10px;">Uploading...</div>');
});
uploadInsertImage.start();
up.refresh(); // Reposition Flash/Silverlight
});
请帮忙!