我想要一个用asp做的简单的图片上传程序,网上的下的太难读了哪位能帮帮忙咯谢谢了
点上传时调uploadsave.asp以下是uploadsave.asp文件<% set upload=new upload_5xsoft set file=upload.file("MarkPicture") if file.fileSize>0 then '自动生成文件名 filename=date() filename=filename&time() filename=replace(filename,"-","") filename=replace(filename,":","") filename=replace(filename," ","") filename=filename+"." filenameend=file.filename filenameend=split(filenameend,".") if filenameend(1)="gif" or filenameend(1)="jpg" then filename=filename&filenameend(1) file.saveAs Server.mappath("../img/pic/"&filename) 'file.saveAs Server.mappath("/equipment/ad/reding/pic/"&filename) 'response.Write(filename) 'response.End session("MarkPicture") = filename response.write filename response.write "已上传成功!" 'response.write "" |返回| 'response.write "" ' response.write "http://active.broadcast.hc360.com/equipment/ad/reding/pic/"&filename 'response.write "|返回|" else response.write "文件格式不对|返回|" 'response.write "|返回|" end if set file=nothing else response.write "文件内容不能为空|返回|" ' response.write "|返回|" end if set upload=nothing response.write "" %>
<SCRIPT language=javascript> <% set upload=new upload_5xsoft set file=upload.file(\"MarkPicture\") if file.fileSize>0 then '自动生成文件名 filename=date() filename=filename&time() filename=replace(filename,\"-\",\"\") filename=replace(filename,\":\",\"\") filename=replace(filename,\" \",\"\") filename=filename+\".\" filenameend=file.filename filenameend=split(filenameend,\".\") if filenameend(1)=\"gif\" or filenameend(1)=\"jpg\" then filename=filename&filenameend(1) file.saveAs Server.mappath(\"../img/pic/\"&filename) 'file.saveAs Server.mappath(\"/equipment/ad/reding/pic/\"&filename) 'response.Write(filename) 'response.End session(\"MarkPicture\") = filename response.write filename response.write \"已上传成功!\" 'response.write \"\" |返回| 'response.write \"\" ' response.write \"http://active.broadcast.hc360.com/equipment/ad/reding/pic/\"&filename 'response.write \"|返回|\" else response.write \"文件格式不对|返回|\" 'response.write \"|返回|\" end if set file=nothing else response.write \"文件内容不能为空|返回|\" ' response.write \"|返回|\" end if set upload=nothing response.write \"\" %> <% set upload=new upload_5xsoft set file=upload.file(\"MarkPicture\") if file.fileSize>0 then '自动生成文件名 filename=date() filename=filename&time() filename=replace(filename,\"-\",\"\") filename=replace(filename,\":\",\"\") filename=replace(filename,\" \",\"\") filename=filename+\".\" filenameend=file.filename filenameend=split(filenameend,\".\") if filenameend(1)=\"gif\" or filenameend(1)=\"jpg\" then filename=filename&filenameend(1) file.saveAs Server.mappath(\"../img/pic/\"&filename) 'file.saveAs Server.mappath(\"/equipment/ad/reding/pic/\"&filename) 'response.Write(filename) 'response.End session(\"MarkPicture\") = filename response.write filename response.write \"已上传成功!\" 'response.write \"\" |返回| 'response.write \"\" ' response.write \"http://active.broadcast.hc360.com/equipment/ad/reding/pic/\"&filename 'response.write \"|返回|\" else response.write \"文件格式不对|返回|\" 'response.write \"|返回|\" end if set file=nothing else response.write \"文件内容不能为空|返回|\" ' response.write \"|返回|\" end if set upload=nothing response.write \"\" %> <% set upload=new upload_5xsoft set file=upload.file(\"MarkPicture\") if file.fileSize>0 then '自动生成文件名 filename=date() filename=filename&time() filename=replace(filename,\"-\",\"\") filename=replace(filename,\":\",\"\") filename=replace(filename,\" \",\"\") filename=filename+\".\" filenameend=file.filename filenameend=split(filenameend,\".\") if filenameend(1)=\"gif\" or filenameend(1)=\"jpg\" then filename=filename&filenameend(1) file.saveAs Server.mappath(\"../img/pic/\"&filename) 'file.saveAs Server.mappath(\"/equipment/ad/reding/pic/\"&filename) 'response.Write(filename) 'response.End session(\"MarkPicture\") = filename response.write filename response.write \"已上传成功!\" 'response.write \"\" |返回| 'response.write \"\" ' response.write \"http://active.broadcast.hc360.com/equipment/ad/reding/pic/\"&filename 'response.write \"|返回|\" else response.write \"文件格式不对|返回|\" 'response.write \"|返回|\" end if set file=nothing else response.write \"文件内容不能为空|返回|\" ' response.write \"|返回|\" end if set upload=nothing response.write \"\" %> <% set upload=new upload_5xsoft set file=upload.file(\"MarkPicture\") if file.fileSize>0 then '自动生成文件名 filename=date() filename=filename&time() filename=replace(filename,\"-\",\"\") filename=replace(filename,\":\",\"\") filename=replace(filename,\" \",\"\") filename=filename+\".\" filenameend=file.filename filenameend=split(filenameend,\".\") if filenameend(1)=\"gif\" or filenameend(1)=\"jpg\" then filename=filename&filenameend(1) file.saveAs Server.mappath(\"../img/pic/\"&filename) 'file.saveAs Server.mappath(\"/equipment/ad/reding/pic/\"&filename) 'response.Write(filename) 'response.End session(\"MarkPicture\") = filename response.write filename response.write \"已上传成功!\" 'response.write \"\" |返回| 'response.write \"\" ' response.write \"http://active.broadcast.hc360.com/equipment/ad/reding/pic/\"&filename 'response.write \"|返回|\" else response.write \"文件格式不对|返回|\" 'response.write \"|返回|\" end if set file=nothing else response.write \"文件内容不能为空|返回|\" ' response.write \"|返回|\" end if set upload=nothing response.write \"\" %>