java--uploadify3.1多文件上传
生活随笔
收集整理的這篇文章主要介紹了
java--uploadify3.1多文件上传
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
使用uploadify時,建議下載uploadify3.1文檔。邊做邊看。
?
?這是頁面端:
<label style="color:#15428B;font-weight:bold;">選擇文件:</label><fieldset style="width:300px;height:33px;border:1px solid #99BBE8;text-align:left;COLOR:#000000;FONT-SIZE:12px;font-family: Verdana;padding:5px;"> <input name="actpic" type="file" id="actpic" /></fieldset>在頁面上寫上相應的js方法:
$('#actpic').uploadify('upload','*');用上面的方法調用下面的
<script type="text/javascript">$(function () {$('#actpic').uploadify({'debug' : false, 'auto' : false, 'multi' : true, 'uploader' : 'admin/uploadyear.action', 'fileObjName' : 'actpic', 'removeCompleted': false, 'progressData' : 'percentage', 'buttonText' : '附件上傳', 'formData' :{'getyearid':${getyearid},'yearReportType':'1','statisform_obj_id':${(statistical_form_name[0][0])?default('0')},'statistical_form_name3':'1','remark_name':'1','other_tagsname':'1','idStr':'1'},'fileTypeDesc' : 'Any Old file you want','method' : 'post', 'cancel' : 'uploadify/uploadify-cancel.png','fileSizeLimit' : '50MB', 'swf' : 'uploadify/uploadify.swf', 'width' : 300,'onUploadStart' :function(file){// alert(file.name);//獲取數據//var statistical_form_name3 = $("#statistical_form_name3").val();var other_tagsname = $("#other_tagsname").val();var remark_name = $("#remark_name").val();var yearReportType = $("#yearReportType").val();//alert(statistical_form_name3);//alert(other_tagsname); alert(yearReportType);// 以下是得到選中的復選框var ids = new Array();var idStr;//if ($("input[name='tagsname']:checked").size() == 0) {// alert("請選擇需要檢索的標簽!");// return false;//}$("input[name='tagsname']:checked").each(function(i, obj) {ids[i] = $(obj).val();});if(ids!=null){idStr = ids.join("-");}//alert(idStr+"ww"); $('#actpic').uploadify("settings","formData",{'idStr':idStr,'statistical_form_name3':file.name,'yearReportType':yearReportType,'other_tagsname':other_tagsname,'remark_name':remark_name});},<#--全部文件上傳完觸發(將信息進行發送)-->'onQueueComplete' : function(queueData) {$.pdialog.closeCurrent();alert("上傳成功");navTab.reload("admin/yearreportList.action", {}, "yearreportList");}});}); </script>我這里是用struts2 的框架 在配上有些傳送數據。
不懂可以提,版主一直在,共同進步
轉載于:https://www.cnblogs.com/Alandre/p/3205719.html
總結
以上是生活随笔為你收集整理的java--uploadify3.1多文件上传的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Vertical Menu ver4
- 下一篇: 数据库三范式的理解(引用其他网友)