Plupload组件点击开始上传按钮后,action类中怎么接收文件
1个回答
展开全部
<head><meta http-equiv="content-type" content="text/html; charset=UTF-8"/><link rel="stylesheet" href="css/jquery-ui.css" type="text/css"/><link rel="stylesheet" href="css/jquery.ui.plupload.css" type="text/css"/><title>Plupload - Events example</title><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/jquery-ui.min.js"></script><script type="text/javascript" src="js/plupload.browserplus-min.js"></script><script type="text/javascript" src="js/plupload.full.js"></script><script type="text/javascript" src="js/jquery.ui.plupload/jquery.ui.plupload.js"></script></head><body><form><div id="uploader"><p>You browser doesn't have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.</p></div></form><script type="text/javascript"> $(function() { $("#uploader").plupload({ // 设置 runtimes : 'gears,flash,silverlight,browserplus,html5,html4', url : 'upload!upload.action', max_file_size : '10mb', chunk_size : '1mb', unique_names : true, // 调整图像clientside resize : {width : 320, height : 240, quality : 90}, // 指定浏览的文件 filters : [ {title : "Image files", extensions : "jpg,gif,png"}, {title : "Zip files", extensions : "zip"} ], // Flash文件地址 flash_swf_url : 'js/file/plupload.flash.swf' }); // 客户端表单验证 $('form').submit(function(e) { var uploader = $('#uploader').plupload('getUploader'); // 文件上传队列if (uploader.files.length >0) { // 当所有的文件上传表单提交 uploader.bind('StateChanged', function() { if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) { $('form')[0].submit(); } }); uploader.start(); } else alert('请至少加载一个文件.'); returnfalse; }); }); </script></body>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询