码迷,mamicode.com
首页 > Web开发 > 详细

图片上传和多图上传

时间:2015-01-15 15:37:30      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:

 

第一种方法:

<a href="javascript:void(0)" class="image_ApplyImage_1" id="la_2">
<label>
上传背面照片</label>
<input type="hidden" id="applyImage2" value="" />
<input type="hidden" id="hideImage2" name="FileID1" value="" />
</a>

<script>

var uPicType = $("#uType").val(),
handlerUrl = $("#url").val();

$("#applyImage2").uploadFile({ key: "img", imgid: "#img_2", uType: 2, picType: 0, inputHidde: "#hideImage2", url:handlerUrl });

</script>

要引入 UploadAtt.js

 

 

第二中:

 

<a href="javascript:void(0)" class="image_ApplyImage_1" id="la_2">
<label>
上传背面照片</label>

</a>
 <div style="position: absolute; left: -99999px;">
<input type="file" name="image_ApplyImage_2" id="image_ApplyImage_2" onchange="fileSelected(‘image_ApplyImage_2‘,‘upload_form‘,‘2‘);"
accept="image/bmp,image/jpeg,image/png,image/tiff" />
</div>

引入html5upload.js

 

多图上传:

window.onload = function () {
var params = {
uploadServerUrl: "/sation/SationInfo/upload.aspx?id="+<%=ServiceStationID%>, //上传响应页面(必须设置)
maxFileData: 1024 * 300, //300KB
jsFunction: "upload", //上传成功后回调JS
filter: "*.jpg;*.png;" //上传文件类型限制
}
swfobject.embedSWF("/sation/ImageFlashUpload/flash/uploadImage.swf", "myContent", "580", "200", "10.0.0", "/sation/ImageFlashUpload/flash/expressInstall.swf", params);
}

function upload()
{
$("#divImage").dialog("close");
location =location ;
}

 

把图片路径追加在缓存中区

图片上传和多图上传

标签:

原文地址:http://www.cnblogs.com/q101301/p/4226300.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!