上传演示效果
以下是操作步骤
1、下载相关文件
地址:链接: https://pan.baidu.com/s/1pNgWup18eGh32lXqUqxKAQ
提取码: wt27
2、文件存放在项目中的位置
第三步在对应页面需要上传附件的地方加上下面的两段代码
第一:<%@ taglib prefix="upload" tagdir="/WEB-INF/tags" %> 这是文件要放在tags下的原因之一
第二:原来的代码:
<div class="formC lh">
</div>
添加之后的代码:
<div class="formC lh">
<upload:swfupload upload_url="${basePath }/emailOutbox/uploadFileAttach.do(这里放你上传的路径)"
file_size_limit="50(这里文件大小限制)" file_queue_limit="10" file_upload_limit="10" file_types="*.*"
button_height="22" button_width="140" button_text_left_padding="45" button_text_top_padding="10"
post_params="'containerType':'apply_leave'" fileList="${fileList}(这里用作文件回显)"
/>
<div class="hide" style="margin-top:5px;width: 150px;height:10px;border: 1px solid #000" id="uploadProgressView">
<div style="background-color: green;height: 100%;width:0%;" id="uploadProgress">
</div><span id="uploadPercent"></span>
</div>
</div>
如果要只上传图片,设置file_types可以解决:file_types="*.jpg;*.gif;*.png;*.bmp"
到此添加完毕,可以完美实现多附件上传了,效果就是最开始的显示图;
这个多附件的上传,可以根据自己的实际需要做部分调整,具体样式和逻辑的代码在swfupload.tag文件中
后续会编写文件上传,文件下载详细代码博客……