首先我是使用艾恩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 檔案大家就去網上找吧!。這個是就上傳後的效果圖片了
沒有上傳圖片前
上傳圖片之後