Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Gallery

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Brisbane, Australia
    Posts
    181
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Gallery

    Code:
    ERROR:
    
    Microsoft VBScript runtime error '800a01a8' 
    
    Object required: '[string: "E:\websites\wwwschoo"]' 
    
    /kgsc/gallery.asp, line 125 
    
    CODE:
        <%
        Set cat = Request.QueryString("cat")
        Set ImageFilePath = "E:\websites\wwwschools\kgsc\images\" & cat 'LINE 125
    
        Dim objFSO, objFolder, objFile
        Dim strFileName, strFileExtension
    
        Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
        Set objFolder = objFSO.GetFolder(Server.MapPath(ImageFilePath))
    
        For Each objFile In objFolder.Files
         strFileExtension = LCase(Mid(objFile.Name, InStrRev(objFile.Name, ".", -1, 1) + 1))
         If strFileExtension = "gif" Or strFileExtension = "jpg" Then
          response.write "<tr><td><a href='" & ImageFilePath & "/" & objFile.Name & "'>"
          response.write "<img src='" & objFile.Name & "' width=25></td>"
         End If
        Next
    
        Set objFolder = Nothing
        Set objFSO = Nothing
       %>
    Why doesnt it work? The folder does exist.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,965
    Thanks
    0
    Thanked 236 Times in 233 Posts
    you only use the Set keyword when creating an object variable not a string. Remove the Set before the variable cat and ImageFilePath.

    Set cat = Request.QueryString("cat")
    Set ImageFilePath = "E:\websites\wwwschools\kgsc\images\" & cat 'LINE 125


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •