租摩托车一天多少钱:asp中如何更改文件名

来源:百度文库 编辑:神马品牌网 时间:2024/04/26 04:25:14
asp中如何更改文件名

给你参考一下...

<%
set upload=new upload_5xsoft
set file=upload.file("sf_upfile")
if file.fileSize<1 then
response.write"<script language=javascript>alert('您没有选择图片。~~~\n\n-----请点击浏览按钮,从弹出的窗口中选择要上传的图片。\n\n-----然后点击上传按钮就可以把图片上传了...\n\n-----不过要注意图片的格式哦~~~');history.back()</script>"
response.end
end if
if file.fileSize<10 or file.fileSize>1000*1024 then
response.write "错误:上传的图片大小超过了限制! <a href='javascript:history.go(-1)'>退回上一步</a>"
response.end
end if
upfilename = split(file.FileName,".")
upfileext = upfilename(ubound(upfilename))
if upfileext<>"jpg" and upfileext<>"jpeg" and upfileext<>"gif" and upfileext<>"JPG" and upfileext<>"JPEG" and upfileext<>"GIF"then
response.write "错误:上传的文件格式不对! <a href='javascript:history.go(-1)'>退回上一步</a>"
response.end
end if
ufp="hyz_"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&upfilename(ubound(upfilename))
file.saveas Server.mappath("upload/"&ufp)
%>