|
楼主 |
发表于 2018-4-20 17:08:41
|
显示全部楼层
add.jsp代码是这样的
<td align="right">
<label class="Validform_label">
每日安全点附件:
</label>
</td>
<td class="value" colspan="3">
<table></table>
<div class="form jeecgDetail">
<script type="text/javascript">
var serverMsg="";
$(function(){
$('#dspfilepath').uploadify({
buttonText:'上传文件',
auto:false,
progressData:'speed',
multi:true,
height:25,
overrideEvents:['onDialogClose'],
fileTypeDesc:'文件格式:',
queueID:'filediv_dspfilepath',
fileSizeLimit:'5MB',
swf:'plug-in/uploadify/uploadify.swf',
uploader:'cgUploadController.do?saveFiles&jsessionid='+$("#sessionUID").val()+'',
onUploadStart : function(file) {
var cgFormId=$("input[name='id']").val();
$('#dspfilepath').uploadify("settings", "formData", {
'cgFormId':cgFormId,
'cgFormName':'t_wnllddc_security_control_point',
'cgFormField':'DSPFILEPATH'
});
} ,
onQueueComplete : function(queueData) {
var win = frameElement.api.opener;
win.reloadTable();
win.tip(serverMsg);
frameElement.api.close();
},
onUploadSuccess : function(file, data, response) {
var d=$.parseJSON(data);
if(d.success){
var win = frameElement.api.opener;
serverMsg = d.msg;
}
},
onFallback: function() {
tip("您未安装FLASH控件,无法上传图片!请安装FLASH控件后再试")
},
onSelectError: function(file, errorCode, errorMsg) {
switch (errorCode) {
case - 100 : tip("上传的文件数量已经超出系统限制的" + $('#file').uploadify('settings', 'queueSizeLimit') + "个文件!");
break;
case - 110 : tip("文件 [" + file.name + "] 大小超出系统限制的" + $('#file').uploadify('settings', 'fileSizeLimit') + "大小!");
break;
case - 120 : tip("文件 [" + file.name + "] 大小异常!");
break;
case - 130 : tip("文件 [" + file.name + "] 类型不正确!");
break;
}
},
onUploadProgress: function(file, bytesUploaded, bytesTotal, totalBytesUploaded, totalBytesTotal) {}
});
});
</script>
<span id="file_uploadspan"><input type="file" name="dspfilepath" id="dspfilepath" /></span>
</div>
<div class="form" id="filediv_dspfilepath"></div>
<span class="Validform_checktip"></span>
<label class="Validform_label" style="display: none;">每日安全点附件</label>
</td>
|
-
|