圖片上傳和多圖上傳

來源:互聯網
上載者:User

標籤:

 

第一種方法:

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

 

把圖片路徑追加在緩衝中區

圖片上傳和多圖上傳

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.