uploadify3.2使用


  1. <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>  
  2. <%  
  3.     String basePath = request.getScheme() + "://"  
  4.             + request.getServerName() + ":" + request.getServerPort()  
  5.             + request.getContextPath() + "/";  
  6. %>  
  7.   
  8. <!DOCTYPE html>  
  9. <html>  
  10. <head>  
  11. <title>Uploadify</title>  
  12. <link rel="stylesheet" type="text/css" href="uploadify.css">  
  13. <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>  
  14. <script type="text/javascript" src="jquery.uploadify.min.js"></script>  
  15. <script type="text/javascript">  
  16. $(function() {  
  17.     $('#uploadify').uploadify({  
  18.         //是否自动上传  
  19.         'auto' : false,  
  20.         //按钮相关样式  
  21.         //'buttonClass' : 'class',  
  22.         'buttonCursor' : 'hand',  
  23.         //'buttonImage' : '',  
  24.         'buttonText' : '选择文件',  
  25.         'height' : 30,  
  26.         'width' : 100,  
  27.         //检查是否有已存在的文件  
  28.         //'checkExisting' : '',  
  29.         //显示debug信息  
  30.         'debug' : true,  
  31.         //file相关  
  32.         'multi' : false,  
  33.         'fileObjName' : 'theFile',  
  34.         //'fileSizeLimit' : '100B, KB, MB, or GB',  
  35.         'fileTypeDesc' : '描述文件类型',  
  36.         'fileTypeExts' : '*.gif; *.jpg; *.png',  
  37.         //表单数据  
  38.         //'method' : 'post',  
  39.         //'formData'     : {'someKey' : 'someValue', 'someOtherKey' : 1},  
  40.         //'onUploadStart' : function(file) {  
  41.           //  $("#file_upload").uploadify("settings", "someOtherKey", 2);  
  42.         //},  
  43.         //上传是下面那个进度条  
  44.         //'itemTemplate' : 'html code use instanceId,fileId,fileName,fileSize',  
  45.         //覆盖默认的事件,声明哪些事件会被覆盖  
  46.         //'overrideEvents' : ['',''],  
  47.         //防止缓存  
  48.         //'preventCaching' : true,  
  49.         //显示进度  
  50.         //'progressData' : 'percentage,speed',  
  51.         //指定文件队列的domId  
  52.         //'queueID'  : 'some_file_queue',  
  53.         //一次可以往队列添加多少文件  
  54.         //'queueSizeLimit' : 123,  
  55.         //上传完成的文件是否自定隐藏显示  
  56.         //'removeCompleted' : false,  
  57.         //移除上传完成文件的时间,单位s  
  58.         //'removeTimeout' : 10,  
  59.         //上传出错后会多次尝试  
  60.         //'requeueErrors' : true,  
  61.         //上传完毕后,等待后台返回时间但,单位s  
  62.         //'successTimeout' : 5,  
  63.         //swf  
  64.         'swf' : 'uploadify.swf',  
  65.         'uploader' : 'uploadFile111.jsp'  
  66.         //处理文件的上传  
  67.         //'uploader' : '<%=path%>/assignmentAction!test.action',  
  68.         //同时上传文件个数的限定  
  69.         'uploadLimit' : 1  
  70.     });  
  71. });  
  72. </script>  
  73. </head>  
  74. <body>  
  75.     <input type="file" name="file_upload" id="uploadify" />  
  76. </body>  
  77. </html> 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值