|
Example.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!--#include file="SundyUpload.asp"--> <% '此例子文档编码都是UTF-8,如果是其他编码的系统,请将编码转换为相应的编码,不然表单获取数据可能会乱码 Dim objUpload,opt Dim xmlPath Dim fileFormName,objFile,counter 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 Response.Write("普通表单:" & objUpload.Form("normalForm") & "<BR><BR>")'获取表单数据 For Each fileFormName In objUpload.objFile Set objFile=objUpload.objFile(fileFormName) fileSize = objFile.FileSize strTemp= objFile.FilePath Response.Write strTemp fileName = mid(strTemp,InStrRev(strTemp, "\")+1) If fileSize > 0 Then Response.Write("File Size:" & fileSize & "<BR>") Response.Write("File Name:" & objFile.FilePath & "<BR>") ' Response.Write("File Description:" & objUpload.Form("fileDesc" & counter) & "<BR><BR>") objFile.SaveAs Server.MapPath(".") & "\upload\" & fileName Response.Write "Save at: "&Server.MapPath(".") & "\upload\" & fileName & "<br><br>" End If counter = counter + 1 Next
上一篇:学习ASP有用的代码(很有用哦!)
下一篇:Access与Sql Server之ASP代码比较
|