asp 無重新整理上傳帶預覽程式碼

來源:互聯網
上載者:User
首先我是使用艾恩ASP無組件上傳類的iframe。直接在架構裡面上傳後賦值給父視窗的input。下面就是index.php的代碼了。但是這個這能上傳一張圖片不能批量上傳圖片!  單檔案上傳<br /><iframe frameborder="0" height="60" width="400" name="upload" src="upload.asp"></iframe><br /><input id="file" /><script>function backfn(fname){ document.getElementById("file").value=fname; document.getElementById("fimg").src="upload/"+fname;}</script><img src="" width="50" height="50" id="fimg" />  然後這個是asp後台寫入圖片的代碼了!是asp的注意 <!--#include file="UpLoad_Class.asp"--><%if lcase(request.ServerVariables("REQUEST_METHOD"))="post" thendim uploadset upload = new AnUpLoadupload.Exe = "jpg|bmp|jpeg|gif|png"upload.MaxSize = 2 * 1024 * 1024 '2Mupload.GetData()if upload.ErrorID>0 then  response.Write upload.Descriptionelse dim file,savpath savepath = "upload" set file = upload.files("file1") if file.isfile then  result = file.saveToFile(savepath,0,true)  if result then   msg = file.filename  else   msg = file.Exception  end if end ifend ifset upload = nothing%><a href="upload.asp">重新上傳</a><script>window.parent.backfn.apply(this,["<%=msg%>"]);</script><%else%><form action="upload.asp" method="post" enctype="multipart/form-data" target="upload" id="upfrm"> 檔案 <input type="file" name="file1" /> <input type="submit" value="上傳" /><br /></form><%end if%>


 
至於 這個 UpLoad_Class.asp 檔案大家就去網上找吧!。這個是就上傳後的效果圖片了
沒有上傳圖片前

 


上傳圖片之後

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.