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

热门教程

ASPUpload上传的实现代码(测试通过)4

时间:2022-06-30 11:15:52 编辑:袖梨 来源:一聚教程网

uploadfile.asp

//DTD HTML 4.0 Transitional//EN">





Upload



<%
On Error Resume Next
Server.ScriptTimeOut=999999
if request("act")="upload" then
dim folder,savepath
savepath=Server.MapPath(UploadFilePath)
CreateFolder(savepath)
Set Upload=Server.CreateObject("Persits.Upload")
Upload.SetMaxSize UploadLimitSize*1024, True
Upload.OverwriteFiles = false
if Request.QueryString("PID") = "" then
Upload.ProgressID="010D60EB00C5AA4B"
else
Upload.ProgressID=Request.QueryString("PID")
end if
Count=Upload.Save(savepath)
If Err.Number <> 0 Then
Response.Write "
出现错误: " & Err.Number & "、" & Err.Description &"重新上传
"
End If
If Err.Number = 8 Then
Response.Write "
你上传的文件超过限制("& UploadLimitSize/1024 &"M)重新上传
"
response.end
end if
dim inputname
dim size,rs_upfile
For Each File in Upload.Files
if not CanUpload(File.ext) then
File.Delete

热门栏目