mr_ego
08-01-2002, 09:50 AM
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.
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.