<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% '此例子文档编码都是UTF-8,如果是其他编码的系统,请将编码转换为相应的编码,不然表单获取数据可能会乱码 Dim objUpload,opt Dim xmlPath Dim fileFormName,objFile,counter,RanNum opt = request.QueryString("opt") If opt = "Upload" Then xmlPath = Server.MapPath(request.QueryString("xmlPath"))'将虚拟路径转换为实际路径 Set objUpload=new SundyUpload '建立上传对象 objUpload.UploadInit xmlPath,"utf-8" counter = 1 For Each fileFormName In objUpload.objFile Set objFile=objUpload.objFile(fileFormName) fileSize = objFile.FileSize strTemp= objFile.FilePath fileName = mid(strTemp,InStrRev(strTemp, "\")+1) 'g0= f0=replace(replace(replace(now(),":","")," ",""),"-","")&"."&g0 If fileSize > 0 Then t=Split(filename,".") t1=t(1) RanNum=int(9000*rnd)+1000 filename=year(now)&"."&month(now)&"."&day(now)&"_"&hour(now)&"."&minute(now)&"."&Second(now)&"_"&RanNum&"."&t1 objFile.SaveAs Server.MapPath(".") & "\Upload\ProjectFiles\" & fileName response.write "" response.write "" response.write "" response.write "" response.write "
" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "
Succeed:" & objFile.FilePath & "
Hold:
Size:
" End If counter = counter + 1 Next End If '为上载进度条数据文件(XML文件指定虚拟路径) '最好是随机的,因为可能多个人同时上载,需要不同的进度数据 '这个路径需要在提交的时候传入上载组件中,以便在上载过程中更改进度数据 '客户端使用Javascript来读取此XML文件,显示进度 xmlPath = "upload/" & Timer & ".xml" %> Sundy Upload Progress <%If opt <> "Upload" Then%>
Image :
 
<%end if%>