<%@ Language=VBScript %><% option explicit Response.Expires = -1 Server.ScriptTimeout = 600 %><% Dim uploadsDirVar uploadsDirVar = Server.MapPath("images\uploaded") function TestEnvironment() Dim fso, fileName, testFile, streamTest TestEnvironment = "" Set fso = Server.CreateObject("Scripting.FileSystemObject") if not fso.FolderExists(uploadsDirVar) then TestEnvironment = "Folder " & uploadsDirVar & " does not exist.
The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions." exit function end if fileName = uploadsDirVar & "\test.txt" on error resume next Set testFile = fso.CreateTextFile(fileName, true) If Err.Number<>0 then TestEnvironment = "Folder " & uploadsDirVar & " does not have write permissions.
The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions." exit function end if Err.Clear testFile.Close fso.DeleteFile(fileName) If Err.Number<>0 then TestEnvironment = "Folder " & uploadsDirVar & " does not have delete permissions, although it does have write permissions.
Change the permissions for IUSR_computername on this folder." exit function end if Err.Clear Set streamTest = Server.CreateObject("ADODB.Stream") If Err.Number<>0 then TestEnvironment = "The ADODB object Stream is not available in your server.
Check the Requirements page for information about upgrading your ADODB libraries." exit function end if Set streamTest = Nothing end function function SaveFiles Dim Upload, fileName, fileSize, ks, i, fileKey Set Upload = New FreeASPUpload Upload.Save(uploadsDirVar) If Err.Number<>0 then Exit function ' If something fails inside the script, but the exception is handled SaveFiles = "" ks = Upload.UploadedFiles.keys if (UBound(ks) <> -1) then SaveFiles = "File uploaded successfully: " for each fileKey in Upload.UploadedFiles.keys SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) " Session.Contents("tequilarClipArtFile")=Cstr(Upload.UploadedFiles(fileKey).FileName) next else SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system." end if end function%>
Upload files:
<% Dim diagnostics if Request.ServerVariables("REQUEST_METHOD") <> "POST" then diagnostics = TestEnvironment() if diagnostics<>"" then response.write "
" response.write diagnostics response.write "

After you correct this problem, reload the page." response.write "

" end if else response.write "
" response.write SaveFiles() response.write "
" dim i%>

<% Dim jlar,klar,mlar,fromedit klar=""& Request.ServerVariables("HTTP_REFERER") mlar="" fromedit="" if Right(klar,10)="larEdit=on" then For jlar=Len(klar)-11 to 1 Step -1 if IsNumeric(Mid(klar,jlar,1)) then mlar=Mid(klar,jlar,1) & mlar else Exit For end if Next if IsNumeric(mlar) then fromedit="&larID="& mlar &"&larEdit=on" end if end if %>
<%=fromedit%>" method="post"> <% if Session.Contents("tequilalarPrev")<>"ClipOrUpload" then%>"><% else%><% end if%> <% Dim tmpname tmpname="" For each i in Session.Contents if left(i,14)="tequilalarCont" then elseif left(i,14)="tequilalarSucc" then elseif left(i,14)="tequilaSuccess" then elseif left(i,14)="tequilalarForm" then elseif left(i,14)="tequilalarPrev" then elseif Left(i,7)="tequila" then tmpname=Right(i,len(i)-7) Response.Write "" & vbcrlf end if Next%>
<% end if%>