This shows you how to upload a file using asp. Note you will need the aspupload component from Persists software.
Take the object from a form
Now save it from the form.
<%
Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.OverwriteFiles = False
Upload.SetMaxSize 4000000, True
Upload.Save "d:\webprojects\test"
If Err.Number = 8 Then
Response.Write "Your file is too large, we do not accept file sizes over
3mb."
Else
If Err <> 0 Then
Response.Write “An error occurred: ” & Err.Description
Else
Set File = Upload.Files(”FILE1″)
Ext = UCase(Right(File.Path, 3))
If Ext <> “TXT” and Ext <> “DOC” Then
Response.Write “I’m sorry the file you uploaded
” & File.FileName & “ is not a .doc or .txt.
We do not accept any other file types.”
File.Delete
kill_code = 1
else
Response.Write “Thank you, your file has been attached”
End If
End If
End If
If kill_code <> 1 then
If Not File Is Nothing Then
file_code = File.FileName
End If
end if
%>
<%
'Response.Write Count.File.Name
'file_code = File.Name
%>
This is the file name it was saved as <%= file_code %>
