Set Upload = Server.CreateObject("Persits.Upload")
' Prevent overwriting
Upload.OverwriteFiles = False
' We use memory uploads, so limit file size
Upload.SetMaxSize 1000000, true
' Save to memory
Upload.Save
' Use session ID as the new file name
NewName = Session.SessionID
For Each File in Upload.Files
File.SaveAs "c:\upload\" & NewName & File.ext
Response.Write "New name: " & File.FileName & "<BR>"
Next方法二:
Set Upload = Server.CreateObject("Persits.Upload")
' Prevent overwriting
Upload.OverwriteFiles = False
' Save to disk
Upload.Save "c:\upload"
' Use session ID as the new file name
NewName = Session.SessionID
For Each File in Upload.Files
File.Copy "c:\upload\" & NewName & File.ext
File.Delete
Response.Write "New name: " & NewName & File.ext & "<BR>"
Next
评论(0)
暂无评论。