List Files in a Web Folder

Discussion in 'ASP General' started by J P Singh, Sep 5, 2003.

  1. J P Singh

    J P Singh Guest

    Hi All

    I want to create a webpage which will list all the files in particular
    folder and hyperlink to them to allow users to view the grpahics online
    without having to send each file to them by email.

    I got the following code but gives me a VBScript error. I have created a
    folder called files under the home directory of this website and have added
    the name of the folder

    Can someone please help?


    <%@ LANGUAGE=VBScript %>
    <%
    Dim ofs,of
    Dim fi
    set ofs = createobject("Scripting.FileSystemObject")
    set of = ofs.getFolder("files") ' blieve this is the problem
    For Each fi In of
    Response.Write("<a href='" + fi.Name + "'>" + fi.Name + "<br>")
    Next fi
    %>

    Microsoft VBScript compilation error '800a0401'
    Expected end of statement

    /default.asp, line 13

    Next fi
    -----^
    J P Singh, Sep 5, 2003
    #1
    1. Advertising

  2. J P Singh

    Randy Rahbar Guest

    > Next fi
    > -----^


    Get rid of the fi and try again. It should just be Next.
    Randy Rahbar, Sep 5, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. THY
    Replies:
    3
    Views:
    2,910
    Alvin Bruney
    Oct 16, 2003
  2. John
    Replies:
    2
    Views:
    4,666
    Mythran
    Oct 23, 2004
  3. Replies:
    4
    Views:
    2,124
  4. =?Utf-8?B?a2V2aW4=?=

    exclude obj folder in web install folder

    =?Utf-8?B?a2V2aW4=?=, Aug 20, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    571
    =?Utf-8?B?a2V2aW4=?=
    Aug 20, 2007
  5. Replies:
    7
    Views:
    386
    Gabriel Genellina
    Sep 25, 2007
Loading...

Share This Page