upsoft.asp
资源名称:1.rar [点击查看]
上传用户:ziqing_518
上传日期:2022-08-09
资源大小:446k
文件大小:2k
源码类别:
多媒体编程
开发平台:
ASP/ASPX
- <!--#include file="db/user.asp" -->
- <!--#include file="config.asp" -->
- <!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library"-->
- <body style="font-size: 9pt" bgcolor="#F7F7F7">
- <%
- FilePath=strLujing_1
- FileMaxSize=numUnsize_1*1024
- FileType=strLeixin_1
- fileweb=strAddess_1
- function makefilename(fname)
- fname = now()
- fname = replace(fname,"-","")
- fname = replace(fname," ","")
- fname = replace(fname,":","")
- fname = replace(fname,"PM","")
- fname = replace(fname,"AM","")
- fname = replace(fname,"上午","")
- fname = replace(fname,"下午","")
- makefilename=fname
- end function
- %>
- <!--#include FILE="update/upload_5xsoft.inc"-->
- <%
- dim upload,file,formName,iCount
- set upload=new upload_5xSoft ''建立上传对象
- UpFilePath = FilePath
- if right(UpFilePath,1)<>"/" then UpFilePath=UpFilePath&"/"
- iCount=0
- for each formName in upload.file
- set file=upload.file(formName)
- if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
- if file.FileSize<FileMaxSize then ''如果未超过文件大小限制
- if FileType<>"" then '如果限制了上传文件类型
- if Instr(FileType,GetExtendName(file.FileName)) then
- TypeFlag = 1 '文件为允许的类型
- else
- TypeFlag = 0 '文件为不允许的类型
- Response.write "不支持您所上传的文件类型:"
- Response.write GetExtendName(file.FileName)
- Response.write "<br>"
- end if
- end if
- if TypeFlag = 1 then
- vfname = makefilename(now())
- fname = vfname & iCount & "." & GetExtendName(file.FileName)
- file.SaveAs Server.mappath(UpFilePath&fname)
- response.write file.FilePath&file.FileName&" ("&file.FileSize&") => 上传文件成功! <br>"
- response.write "<script>parent.document.frmAnnounce.down1.value='"&fileweb&UpFilePath&fname&"'</script>"
- iCount=iCount+1
- FileNameStr = UpFilePath&fname
- end if
- else
- response.write "文件大小超出限制,您最多可以上传 "& FileMaxSize &"个字节的文件数据"
- exit for
- end if
- end if
- set file=nothing
- next
- set upload=nothing
- function GetExtendName(FileName)
- dim ExtName
- ExtName = LCase(FileName)
- ExtName = right(ExtName,3)
- ExtName = right(ExtName,3-Instr(ExtName,"."))
- GetExtendName = ExtName
- end function
- conn.close
- set conn=nothing
- %>
- </body>