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>
相关文章推荐
- TestNG 学习总结 - 参数化测试(十二)
- IOS学习之——用NSUserDefaults保存和读取程序设置
- asp.net js与后台C#代码相互调用
- 1到n的和、阶乘以及阶乘的和
- 第8周项目1
- 第一篇文章 用来测试
- 第八周项目-建立一个简单的学生信息表
- 第七周项目3-用多文件组织多个类的程序1.game.h:类声明
- STM32F4毕业设计(1)
- 第8周项目1 数组做数据成员 工资类(1)
- Java中的接口知识汇总
- 你真的会用Context么?
- ExtJs 入门教程
- 搜索—二分三分搜索—1004
- Velocity教程
- Android SharedPreferences详解
- TestNG 学习总结 - 依赖测试(十一)
- 面试经历
- 第七周项目2-友元类
- 如何阅读一本书(10)