%@ Language=VBScript %>
<%
Response.Expires = 600
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>
<%
' ****************************************************
' Change the value of the variable below to the pathname
' of a directory with write permissions, for example "C:\Inetpub\wwwroot"
Dim uploadsDirVar
uploadsDirVar = "d:\users\artorde\data"
' ****************************************************
' 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/
if (Request.QueryString("r")="upload") then
response.write "
"
response.write SaveFiles()
response.redirect "http://www.artorder.co.uk/specialform.asp"
end if
if (Request.QueryString("r")="delete") then
Call Delfiles(Request.QueryString("file"),false)
response.redirect "http://www.artorder.co.uk/specialform.asp"
end if
function SaveFiles()
Dim Upload, fileName, fileSize, ks, i, fileKey
Set Upload = New FreeASPUpload
Upload.Save(uploadsDirVar)
' If something fails inside the script, but the exception is handled
If Err.Number<>0 then Exit function
SaveFiles = ""
AttFiles = ""
session.contents.remove("attfiles")
ks = Upload.UploadedFiles.keys
if (UBound(ks) <> -1) then
SaveFiles = "Files uploaded: "
for each fileKey in Upload.UploadedFiles.keys
SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) "
if (AttFiles <> "") then
AttFiles = AttFiles & ";" & Upload.UploadedFiles(fileKey).FileName
else
AttFiles = Upload.UploadedFiles(fileKey).FileName
end if
next
session("attfiles") = AttFiles
else
SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system."
end if
end function
%>
WWW.ARTORDER.CO.UK - FINE ART PAINTINGS BY SIMON WRIGHT