[FileName]:upload.asp
[Code]:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#i nclude virtual="upload.inc"-->
<%
If Request.ServerVariables("REQUEST_METHOD")="POST" then
'表单提交执行
CONST upFileSize=100 '文件大小限制,单位:KB
CONST upFileType=".gif.jpg.jpeg" '文件类型限制,可根据需要修改
CONST targetPath="/publish/images/" '以网站为根目录的文件存放路径,以"/"结束
dim upload,thisFile,formName,iCount
set upload=new upload_5xSoft ''建立上传对象
Flag=True '初始化文件上传标识
for each formName in upload.ifile '列出上传文件的所有参数
set thisFile=upload.ifile(formName) '生成一个文件对象
If thisfile.filesize=0 then
Flag=False
Msg="请选择你要上传的文件。"
CALL showErr(Msg)
end if
if thisfile.filesize>upFileSize*1024 then
Flag=False
Msg="文件大小超过了限制。"
CALL showErr(Msg)
end if
if Instr(upFileType,GetExtendName(thisfile.FileName))
| 对此文章发表了评论 |

