<HTML>
<BODY>
<%
Set Upload = Server.CreateObject("Persits.Upload")
' we use memory uploads, so we must limit file size
Upload.SetMaxSize 100000, True
' Save to memory. Path parameter is omitted
Count = Upload.Save
' Two files must be selected
If Count <> 2 Then
Response.Write "You must select 2 files."
Response.End
End If
' Create two folders, ignore "already exists" error
Upload.CreateDirectory "c:\upload\Folder1", True
Upload.CreateDirectory "c:\upload\Folder2", True
' Obtain File objects
Set File1 = Upload.Files("FILE1")
Set File2 = Upload.Files("FILE2")
' Build name from session ID
Name = Session.SessionID
' Save
File1.SaveAs "c:\upload\Folder1\" & Name & File1.Ext
Response.Write "File 1 is saved under " & File1.Path & "<BR>"
File2.SaveAs "c:\upload\Folder2\" & Name & File2.Ext
Response.Write "File 2 is saved under " & File2.Path & "<BR>
%>
</BODY>
</HTML>
|