upfile.asp

来自「asp+access开发的网上购物程序」· ASP 代码 · 共 28 行

ASP
28
字号
<%@ codepage ="936" %><%OPTION EXPLICIT%><%dim upload,file,formName,formPath,iCountset upload=new upload_5xSoft ''建立上传对象response.write upload.Version&"<br><br>" ''显示上传类的版本if upload.form("filepath")="" then ''得到上传目录HtmEnd "请输入要上传至的目录!"set upload=nothingresponse.endelseformPath=upload.form("filepath")''在目录后加(/)if right(formPath,1)<>"/" then formPath=formPath&"/" end ifiCount=0for each formName in upload.file ''列出所有上传了的文件set file=upload.file(formName) ''生成一个文件对象if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据file.SaveAs Server.mappath(formPath&file.FileName) ''保存文件response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" 成功!<br>"iCount=iCount+1end ifset file=nothingnextset upload=nothing ''删除此对象%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?