Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Path passed with form not working in FireFox

Status
Not open for further replies.

Stoemp

Programmer
Sep 25, 2002
389
BE
Hi

I'm making a sort of file and folder indexer in ASP. I tested it in IE and it worked fine. Now in Firefox it won't work.

I have a textbox where the user submits a path string. If he clicks the submit button, a new asp page is called and it uses the string to set the base path of the iteration to print folders, subfolders and files. In Firefox I get the error 'Can't find the path'. Should I do something special?

Thanks

Steven
 
hmm..cant really answer without looking at some code...

are you by any chance using code which has something like...

document.all or document.getElementById

-DNG
 
Hi DNG

I'm not using any kind of DOM scripting. I can post some source code here. Here it is:
Code:
Private sub printFolders(path, level)

    Dim objFSO, objFolder, objSubfolder, objFile, iTeller, iTeller2

    If level = 0 Then
    
        Response.Write "<div><img src=""./maps/openFolder.gif"" />&nbsp;" & path & "</div>"
        level = level + 1
    
    End If
    
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    
    Set objFolder = objFSO.GetFolder(path)
    
    For Each objSubFolder in objFolder.Subfolders
    
        Response.Write "<div style=""margin: -1px;"">"
        
        For iTeller = 0 to level - 2
        
            Response.Write "<img src=""./maps/stripes.gif"" />"
        
        Next
        
        Response.Write "<img src=""./maps/corner.gif"" />&nbsp;<img src=""./maps/openFolder.gif"" />&nbsp;" & objSubfolder.Name & "</div>"
        printFolders objSubFolder.path, level+1
        
        For Each objFile in objSubFolder.Files
        
            Response.Write "<div>"
        
            For iTeller2 = 0 to level - 1
        
                Response.Write "<img src=""./maps/stripes.gif"" />"
        
            Next

            Response.Write "<img src=""./maps/corner.gif"" />&nbsp;<img src=""./maps/" & lcase(right(objFile.name, 3)) & ".gif"" />&nbsp;" & objFile.name & " <span class=""fileDetails"">(" & Round(objFile.size / 1048576, 2) & "Mb, Last modified: " & objFile.DateLastModified & ")</span></div>"

        Next
         
    Next

    level = level + 1
    
End Sub

This is the function that prints the folder structure of a specified location. I just get the path from the form with this code:
Code:
sFolder = Trim(Request.Form("folder"))
        
If sFolder <> "" Then
        
     printFolders sFolder, 0
        
Else
        
     Response.Redirect("index.asp")
        
End If

And this is it really. Some HTML code in between to show the form and that's it. I just started today, so there's not much going on yet.

Thanks

Steven
 
after a first glance of the code...all i would like to warn you is

"if your tags(<div> etc...) are not structured or nested properly, then firefox throws an error"

so make sure that you have everything intact and in order...

-DNG
 
I'm pretty sure that my tags are nested perfectly. I don't think this could have anything to do with my asp going bad. Here's the string that my asp page receives after submitting the path in the input field of the form:
Code:
folder=O%3A%5CDocuments%5CProduct+Information%5CFood%5C&submit=Choose+folder

The original folder I put in the input field is:
Code:
O:\Documents\Product Information\Food\
 
how about trying this:

sFolder = Server.HTMLEncode(Request.Form("folder"))
sFolder = Trim(sFolder)

-DNG
 
Tried it and still getting the same error... Very strange. Could it have something to do with some settings of IIS?
 
>>sFolder = Trim(Request.Form("folder"))

but the "folder" is coming in a query string???

Known is handfull, Unknown is worldfull
 
No, the folder is coming in a form. I check if the folder is empty, but it isn't, so the code executes. I got the message now in IE too... pfff I don't know what's happening here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top