Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Create a folder to view from website (2003)

    Is any way to view a folder (Locate at webserver) from the website?

    Users would like to view a folder that locate at webserver by click a link on one of web page, so I put the folder in the webserver and create a label with link to the folder. But I get the error page: You are not authorized to view this page.

    Thanks

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Create a folder to view from website (2003)

    Most web servers now are configured by default to prevent directory browsing. You almost certainly can turn off that protection for a particular folder, but I'm not sure whether you can turn it off just for one user.

    For Internet Information Services (IIS), Microsoft has published an article on how you can simulate directory browsing with an ASP page. This might be easier than changing the actual directory permissions if you are using an external hosting provider. However, I haven't tried it myself. See: Creating a directory browsing page using ASP (MSKB 224364).

    If you are using Apache, then of course ASP isn't a good choice. Googling for directory browsing apache probably will provide much better results than I could give.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a folder to view from website (2003)

    Thanks. That's really helpful information.

    I have tried the Microsoft's ASP page. How can I hide the default.asp that appears in the contents the folder?

    Thanks

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Create a folder to view from website (2003)

    > I have tried the Microsoft's ASP page. How can I hide the default.asp that appears in the contents the folder?

    Well, I think you need to choose your approach. Either you disable directory browsing and have default.asp do the work, or you enable directory browsing and delete default .asp. Does that make sense?

  5. #5
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a folder to view from website (2003)

    Thanks.

  6. #6
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create a folder to view from website (2003)

    Hi,

    I am using the following ASP codes and able to create a directory browsing page. However, I have a big problem: User doesn't have any problem to view the file from this page. However, if user is not on company domain, and then a windows prompted for a username & password in order to open the file, even if user on the company network.

    Set objCollection = objFolder.Files

    For Each objItem in objCollection
    If Lcase(objItem.Name) <> "default.asp" then
    Dim strTitle
    strName = objItem.Name
    If strName = "install.exe" then
    strTitle = "System Install File"
    Else
    strTitle = strName
    End if
    strFile = Server.HTMLEncode(Lcase(strName))

    intSizeB = objItem.Size
    intSizeK = Int((intSizeB/1024) + .5)
    If intSizeK = 0 Then intSizeK = 1

    strAttr = MakeAttr(objItem.Attributes)
    strName = Ucase(objItem.ShortName)
    If Instr(strName,".") Then strExt = Right(strName,Len(strName)-Instr(strName,".")) Else strExt = ""
    dtmDate = CDate(objItem.DateLastModified)
    %>
    <tr>
    <td align="left"><%=strTitle%></td>
    <td align="right"><%=FormatNumber(intSizeB,0)%></td>
    <td align="right"><%=intSizeK%>K</td>
    <td align="left"><tt><%=strAttr%></tt></td>
    <td align="left"><%=strExt%></td>
    <td align="left"><%=objItem.Type%></td>
    <td align="left"><%=FormatDateTime(dtmDate,vbShortDate )%></td>
    <td align="left"><%=FormatDateTime(dtmDate,vbLongTime) %></td>
    </tr>
    <%
    End if
    Next
    %>



    This doesn't happen with other files on my regular html pages.

    Please help!!!

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Create a folder to view from website (2003)

    What kind of security applies to this site? Windows integrated authentication? Anonymous access? Perhaps the settings are different on the files than they are on .asp pages.

    Also, do the paths in your page as rendered appear to be valid "relative" URLs?

Posting Permissions

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