一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

asp 无刷新上传带预览程序代码

时间:2015-03-28 编辑:简简单单 来源:一聚教程网

首先我是使用艾恩ASP无组件上传类的iframe。直接在框架里面上传后赋值给父窗口的input。下面就是index.php的代码了。但是这个这能上传一张图片不能批量上传图片!
 
 单文件上传








 
 
然后这个是asp后台写入图片的代码了!是asp的注意
 

<%
if lcase(request.ServerVariables("REQUEST_METHOD"))="post" then
dim upload
set upload = new AnUpLoad
upload.Exe = "jpg|bmp|jpeg|gif|png"
upload.MaxSize = 2 * 1024 * 1024 '2M
upload.GetData()
if upload.ErrorID>0 then 
 response.Write upload.Description
else
 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 if
end if
set upload = nothing
%>
重新上传

<%else%>
 
文件  

<%end if%>


 
至于 这个 UpLoad_Class.asp 文件大家就去网上找吧!。这个是就上传后的效果图片了
没有上传图片前

 


QQ图片20140421102428.jpg

上传图片之后

QQ图片20140421102445.jpg

 

热门栏目