//上传文件
function fileInputUpload(id,url,successfn){
$(\"#\"+id).fileinput({
language: \'zh\', //设置语言
overwriteInitial: true,
maxFileSize: 20480,
allowedFileExtensions: [\'doc\', \'docx\', \'pdf\', \'zip\', \'rar\', \'xls\', \'xlsx\',\'jpg\',\'jpeg\',\'png\'],
uploadAsync: true,
showPreview: false,
showRemove: true,
uploadUrl: url,
ajaxSettings: {
async: false,
dataType: \'json\',
success: function(result) {
successfn(result);
}
}
});
}
//上传文件调用
fileInputUpload(\"uploadFile\",\"${ctx}/upload.do\",function(result){
var path = \'\',name=\'\',html = \'\';
$(result).each(function(index, item) {
path += item.relativePath + \';\'
name += item.fileName+\';\';
html += \'<p><a href=\"\' + item.relativePath + \'\" class=\"colorActive\" target=\"_blank\">\' + item.fileName + \'</a></p>\'
});
$(\'#extFilePath\').val(path.substr(0, path.length - 1));
$(\'#extFileName\').val(name.substr(0, name.length - 1));
$(\'.js_file_show\').html(html);
});
版权声明
本文仅代表作者观点,不代表百度立场。
本文系作者授权百度百家发表,未经许可,不得转载。



