您的位置:首页 > 其它

swfupload学习

2016-04-21 08:52 239 查看
JS中加入如下代码,其中一些参数按自己需要更改
var swfu;
window.onload = function() {
swfu = new SWFUpload({
flash_url : "${ctx}/js/swfupload/js/swfupload.swf",
upload_url: "${ctx}/common/attach!multipleUploadSubmit.do",
//upload_url: "http://127.0.0.1:8080/up/PictureAction.action",

post_params: {"attach.jobno" : "${jobno}","attach.cjdjh":"${cjdjh}"},
file_post_name: "atch",
file_size_limit : "100 MB",
file_types : "*.*",
file_types_description : "All Files",
file_upload_limit : 100,
file_queue_limit : 0,
custom_settings : {
progressTarget : "fsUploadProgress",
cancelButtonId : "btnCancel"
},
debug: false,
// Button settings
button_image_url: "${ctx}/js/swfupload/images/TestImageNoText_103x24.png",
button_width: 103,
button_height: 24,
button_placeholder_id: "spanButtonPlaceHolder",
button_text: '<span class="theFont"></span>',
button_text_style: ".theFont {font-size: 12; cursor:pointer;border:1px solid #eee;}",
button_text_left_padding: 12,
button_text_top_padding: 3,

// The event handler functions are defined in handlers.js
file_queued_handler : fileQueued,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_start_handler : uploadStart,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadMySuccess,
upload_complete_handler : uploadComplete,
//queue_complete_handler : uploadComplete	// Queue plugin event
});
};
html代码,其中<span style="font-family: Arial, Helvetica, sans-serif;">spanButtonPlaceHolder是必要的</span>

<div>
<span id="spanButtonPlaceHolder"></span>
</div>
<div class="mtp05">
<input type="button" id="ss" class="ui_bton ui_bton_upload" value="上传选中文件" />
</div>
<div>
<input type="button" id="btnCancel" class="ui_bton ui_bton_delete" disabled="disabled" value="取消上传队列" onclick="swfu.cancelQueue();" />
</div>
</td>
<td>
<div class="fieldset flash" id="fsUploadProgress">

</div>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: