Upload | download
Altogether 3 files
<--upfile.asp-->http://ktgirl001.0033.cn
<%option explicit%>
<%Server.ScriptTimeOut=5000%>
<!--#include file= "Upload_5xsoft.inc"-->
<title> File Upload </title>
<body>
<br> transformation File Upload!<%
Dim Upload,file,formname,formpath,icount
Set upload=new upload_5xsoft ' Build upload Object
Response.Write Upload. version& "<br><br>" shows the version of the uploaded class
If Upload.form ("filepath") = "then" gets uploaded directory
Htmend "Please enter the directory you want to upload!"
Set upload=nothing
Response.End
Else
Formpath=upload.form ("filepath")
"Add (/) to the directory
If Right (formpath,1) <> "/" Then formpath=formpath& "/"
End If
Icount=0
For every formName in Upload.objform ' Lists all form data
Response.Write formname& "=" &upload.form (formName) & "<br>"
Next
Response.Write "<br>"
For every formName in Upload.objfile ' lists all uploaded files
Set File=upload.file (formName) ' generates a File object
If file. Filesize>0 Then ' if FileSize > 0 indicates file data
File. SaveAs Server.MapPath (formpath&file. FileName) ' Save file
Response.Write file. Filepath&file. filename& "(" &file. filesize& ") =>" &formPath&File.FileName& "Success!<br>"
Icount=icount+1
End If
Set file=nothing
Next
Set Upload=nothing ' Deletes this object
Htmend icount& "File Upload end!"
Sub Htmend (MSG)
Set upload=nothing
Response.Write "<br>" &Msg& "[<a href=" "Javascript:history.back ();" " > Return </a>]</body>Response.End
End Sub
%>
</body>