图片上传和多图上传

 

第一种方法:

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

 

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

posted @ 2015-01-15 14:50  小菜鸟飞飞  阅读(409)  评论(0编辑  收藏  举报