<%@ Language=VBScript %> <% option explicit Response.Expires = -1 Server.ScriptTimeout = 600 %> <% Dim fid IDL = request.querystring("ID") response.write IDL 'response.end Dim AdoCon Dim RsID Dim RsP Dim SQLP Dim IDL Dim pt Dim SQLID Dim IDD Dim ImagesPath 'Set AdoCon = server.createobject ("ADODB.CONNECTION") 'AdoCon.Open "Driver={MICROSOFT ACCESS DRIVER (*.mdb)};DBQ=" & server.mappath("fh.mdb") 'Set RsID = server.createobject ("ADODB.RECORDSET") 'SQLID = "select MAX(propID) from ListedProperties" 'RsID.open SQLID,AdoCon,3 'IDD = RsID(0) 'IDL = IDD + 1 pt = "D:\inetpub\virtual\futurehomes\wwwroot\Project_Images\classifieds\" & IDL response.write pt 'response.end ImagesPath = "Project_Images/classifieds/" & IDL & "/" 'response.end '--------test---------- dim fs,f,k set fs=Server.CreateObject("Scripting.FileSystemObject") if fs.FolderExists(pt)=true then k = 1 'response.write("Folder already exists") else set f=fs.CreateFolder(pt) end if set fs=nothing ' **************************************************** ' Change the value of the variable below to the pathname ' of a directory with write permissions, for example "C:\Inetpub\wwwroot" Dim uploadsDirVar uploadsDirVar = pt ' **************************************************** ' 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() %>
Please browse for the images and click ADD then click Upload and wait for the images to be uploaded, Once you get the images uploaded message click Return to Add Property
Upload images:

File 1:
File 2:
File 3:
File 4:

            <% end function 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, r 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 = "" 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) " next else SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system." end if 'SaveFiles = SaveFiles & "
Enter a number = " & Upload.Form("enter_a_number") & "
" 'SaveFiles = SaveFiles & "Checkbox values = " & Upload.Form("checkbox_values") & "
" end function %> Upload Property Images

<% 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 "

" else response.write "
" OutputForm() response.write "
" end if else response.write "
" OutputForm() response.write SaveFiles() response.write "

" end if %>