Aspupload组件使用实例代码
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
<%@EnableSessionState=False%>
<%
Response.Expires = -1
PID = Request("PID")
TimeO = Request("to")
Set UploadProgress = Server.CreateObject("Persits.UploadProgress")
format = "
%T%t%B3%T 速度:(%S/秒) 估计剩余时间:%R %r%U / %V(%P)%l%t"
bar_content = UploadProgress.FormatProgress(PID, TimeO, "#00007F", format)
If "" = bar_content Then
%>
<%
Else ' Not finished yet
%>
Response.Write "?to=" & TimeO & "&PID=" & PID %>">
<% = bar_content %>
<% End If %>
fileconfig.asp
<%
Dim UploadFilePath,UploadLimitSize,NotAllowfileext,BrowerFilePath
UploadFilePath = year(now)&"_"&month(now)&"_"&day(now)&"/"
'文件上传路径
BrowerFilePath = "/"
UploadLimitSize = 1024*50 '50M
'最大上传文件大小,单位为K
NotAllowfileext = "asp|cer|cdx|asa|htw|ida|idq|shtm|shtml|stm|printer|cgi|php|php4|cfm|aspx"
'不可以上传的文件类型
function CanUpload(Fileurl)
Fileurl = lcase("|"& Mid(Fileurl, InstrRev(Fileurl, ".") + 1)& "|")
NotAllowfileextstr = "|"&NotAllowfileext&"|"
if instr(NotAllowfileextstr,Fileurl)>0 then
CanUpload = false
else
CanUpload = true
end if
end function
Function CreateFolder(Filepath)
Dim fso, f
on error resume next
Set fso = CreateObject("Scripting.FileSystemObject")
if not fso.FolderExists(Filepath) then
Set f = fso.CreateFolder(Filepath)
set f = Nothing
end if
set fso = Nothing
End Function
%>
framebar.asp
<%@EnableSessionState=False%>
<% Response.Expires = -1 %>