%@ Language=VBScript %>
<% %><%
option explicit
Response.Expires = -1
Server.ScriptTimeout = 28800
'Stores only files with size less than MaxFileSize
Dim DestinationPath
DestinationPath = Server.mapPath("upload")
Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
Server.ScriptTimeout = 200000
Form.SizeLimit = &H10000000
'{b}Set the upload ID for this form.
'Progress bar window will receive the same ID.
if len(Request.QueryString("UploadID"))>0 then
Form.UploadID = Request.QueryString("UploadID")'{/b}
end if
'was the Form successfully received?
Const fsCompletted = 0
If Form.State = fsCompletted Then 'Completted
'was the Form successfully received?
if Form.State = 0 then
'Do something with upload - save, enumerate, ...
response.write "
Upload result: Form was accepted."
response.write "
Number of file fields:" & Form.Files.Count
response.write "
Request total bytes:" & Request.TotalBytes
Form.Files.Save DestinationPath
response.write "
Files was saved to " & DestinationPath & " folder."
End If
ElseIf Form.State > 10 then
Const fsSizeLimit = &HD
Select case Form.State
case fsSizeLimit: response.write "
Source form size (" & Form.TotalBytes & "B) exceeds form limit (" & Form.SizeLimit & "B)
"
case else response.write "
Some form error.
"
end Select
End If'Form.State = 0 then
'{b}get an unique upload ID for this upload script and progress bar.
Dim UploadID, PostURL
UploadID = Form.NewUploadID
'Send this ID as a UploadID QueryString parameter to this script.
PostURL = Request.ServerVariables("SCRIPT_NAME") & "?UploadID=" & UploadID'{/b}
%>
<%
' ****************************************************
' Change the value of the variable below to the pathname
' of a directory with write permissions, for example "C:\Inetpub\wwwroot"
Dim uploadsDirVar
uploadsDirVar = "c:\inetpub\www.pcedesign.com\upload"
' ****************************************************
' Note: this file uploadTester.asp is just an example to demonstrate
' the capabilities of the freeASPUpload.asp class. There are no plans
' to add any new features to uploadTester.asp itself. Feel free to add
' your own code. If you are building a content management system, you
' may also want to consider this script: http://www.webfilebrowser.com/
function OutputForm()
%>
|
|
|
|
|
Company Profile | Capabilities | Experience | Key Personnel | Partial Client List | Downloads © 2000 Power Consulting Engineers
Contact Us | Partners | Links | Positions Available | Home