图片上传和多图上传

 

第一种方法:

<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 ;
}

 

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

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。