怎么实现上传三张图啊,用代码片,这是页面代码

qq1061129458 2013-08-08 03:38:23
<table width="100%" cellpadding="0" cellspacing="1" align="center" bgcolor="#fcc9a8" style="margin-top:5px;">
<tr>
<td class="td_dsp">大 图 名 称 :<b style="font-size: 12px"></b></td>
<td class="td_value" colspan="3">
<s:textfield id="name" name="ads.name" />
</td>
</tr>
<tr>
<td class="td_dsp">
选 择 产 品 :
<b style="font-size: 12px"></b>
</td>
<td class="td_value" colspan="3">
<input type="hidden" id="productIds" name="productIds"
value="<s:property value="#request.productIds"/>" />

<input id="productNames" name="productNames"
value="<s:property value="#request.productNames"/>"
readonly="readonly" style="width: 150px;"
onfocus="showProduct('id');" />

<a href="javascript:showProduct('id');" class="search"
onfocus="this.blur();"> <img src="images/search.png" /> </a>
</td>
</tr>
<tr>
<td class="td_dsp">
页面图片一:
</td>
<td class="td_value" colspan="3">
<input type="file" class="file" name="file" id="file"/><button onclick="doUpload()">上传</button>
<br />
<span id="upload_error1" style="color: red;"></span>
<span class="form-info">图片格式支持:png/jpeg/jpg;自动截取690*280</span>
<br />
<s:if test="tmpFileName != '' and tmpFileName != null">
<img src="${TMP_URL}/<s:property value="tmpFileName"/>"/>
</s:if>
<s:elseif test="ads.ldpiPic != null and ads.ldpiPic != ''">
<img src="${WEB_HOME_FLASH_URL}/<s:property value="ads.ldpiPic"/>"/>
</s:elseif>
<s:else>
<img src="<%=path%>/images/no_pic.png"/>
</s:else>
</td>
</tr>
<tr>
<td class="td_dsp">
页面图片二:
</td>
<td class="td_value" colspan="3">
<input type="file" class="file" name="files" id="files"/><button onclick="doUpload()">上传</button>
<br />
<span id="upload_error1" style="color: red;"></span>
<span class="form-info">图片格式支持:png/jpeg/jpg;自动截取690*280</span>
<br />
<s:if test="tmpFileNames != '' and tmpFileNames != null">
<img src="${TMP_URL}/<s:property value="tmpFileNames"/>"/>
</s:if>
<s:elseif test="ads.mdpiPic != null and ads.mdpiPic != ''">
<img src="${WEB_HOME_FLASH_URL}/<s:property value="ads.mdpiPic"/>"/>
</s:elseif>
<s:else>
<img src="<%=path%>/images/no_pic.png"/>
</s:else>
</td>
</tr>
<tr>
<td class="td_dsp">
页面图片三:
</td>
<td class="td_value" colspan="3">
<input type="file" class="file" name="filess" id="filess"/><button onclick="doUploads()">上传</button>
<br />
<span id="upload_error1" style="color: red;"></span>
<span class="form-info">图片格式支持:png/jpeg/jpg;自动截取690*280</span>
<br />
<s:if test="tmpFileNamess != '' and tmpFileNamess != null">
<img src="${TMP_URL}/<s:property value="tmpFileNamess"/>"/>
</s:if>
<s:elseif test="ads.hdpiPic != null and ads.hdpiPic != ''">
<img src="${WEB_HOME_FLASH_URL}/<s:property value="ads.hdpiPic"/>"/>
</s:elseif>
<s:else>
<img src="<%=path%>/images/no_pic.png"/>
</s:else>
</td>
</tr>
</table>
<table align="center">
<tr>

<td>
<button class="btn" type="submit" id="add_btn">
提交
</button>      
<button class="btn" onclick="reList()" >
取消
</button>
<br />
</td>
</tr>
</table>
</s:form>

</div>
<div id="loadDivBg"
style="display: none; overflow: hidden; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 1; background-color: #ffebd7; text-align: center;"></div>
<%-- 选择产品 --%>
<div id="searchProduct"
style="background-color: #ffffff; border: 1px solid #ffb07b; display: none; position: absolute; left: 50%; top: 50%; margin-left: -400px; margin-top: -200px; width: 800px; height: 400px; z-index: 2;">
<div class="table_th">
<div style="float: left; width: 80px;">
请选择产品
</div>
<div
style="float: right; width: 40px; height: 25px; line-height: 25px;">
<a href="javascript:hideProduct();" title="关闭"><img
src="images/delete.png" /> </a>
</div>
</div>
<iframe id="productFrame" frameborder="0"
style="width: 800px; height: 374px;"></iframe>
</div>

</body>
</html>
...全文
133 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
s478853630 2013-08-08
  • 打赏
  • 举报
回复
顶一下楼主,看看这个能用不
yang463488415 2013-08-08
  • 打赏
  • 举报
回复
qq1061129458 2013-08-08
  • 打赏
  • 举报
回复
刚出来,学习呢。。。。。。
S117 2013-08-08
  • 打赏
  • 举报
回复
为什么不找个上传插件呢? 省事多了!

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧