Useing ASP folder object to read all files in the folder on the server

Discussion in 'Classic ASP' started by caribbeanf1, Jul 10, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi All, can nayone assist me with this issue.
    I cam trying create a simply online photo album and are trying to asp folder object to read the image files from a folder, but I am not being successful.

    Here is what I did:





    <%
    Dim fs,fo
    Set fs=Server.CreateObject("Scripting.FileSystemObject")
    Set fo=fs.GetFolder("\powellsvacation")for each x in fo.files
    'Print the name of all files in the test folder
    Response.write(x.Name &amp; "")
    nextset fo=nothing
    set fs=nothing
    %>


    set fo=nothing
    set fs=nothing
    %>
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Try change this line

    Set fo=fs.GetFolder("\powellsvacation")

    to

    Set fo = fs.GetFolder(server.mappath("\powellsvacation"))

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Thanks Bruce, I will try that.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page