IIS 5.0 Error path not fond

Discussion in 'ASP General' started by Stas, Jan 25, 2004.

  1. Stas

    Stas Guest

    Hello All!
    I found function for enumerate files in special folder and pasted in my asp
    page, but Server generate error.
    Who could tell me why server IIS 5.0 generate error, and how I must input
    path for http://host/pdf?
    <%
    function ShowFolderFileList(folderspec)
    {
    var fso, f, f1, fc, s;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    f = fso.GetFolder(folderspec);
    fc = new Enumerator(f.files);
    s = ""; for (; !fc.atEnd(); fc.moveNext())
    {
    s += fc.item();
    s += "";
    }
    return(s);
    }
    var str;
    str = ShowFolderFileList('http://localhost/pdf'); or str =
    ShowFolderFileList('/pdf');
    ^^^^^^^^^^^^^^^ error at this string Path not found

    Response.Write(str);
    %>
    Thanks.
    Stas.
     
    Stas, Jan 25, 2004
    #1
    1. Advertising

  2. Stas

    Lance Wynn Guest

    You need to give it the local path to the file, not the url. Look in the
    help files for Server.MapPath that returns a string showing the actual
    physical path of a file within the website.
    I believe you'd do:
    str = ShowFolderFileList(mapPath('/pdf'))

    Lance

    "Stas" <> wrote in message
    news:...
    > Hello All!
    > I found function for enumerate files in special folder and pasted in my

    asp
    > page, but Server generate error.
    > Who could tell me why server IIS 5.0 generate error, and how I must input
    > path for http://host/pdf?
    > <%
    > function ShowFolderFileList(folderspec)
    > {
    > var fso, f, f1, fc, s;
    > fso = new ActiveXObject("Scripting.FileSystemObject");
    > f = fso.GetFolder(folderspec);
    > fc = new Enumerator(f.files);
    > s = ""; for (; !fc.atEnd(); fc.moveNext())
    > {
    > s += fc.item();
    > s += "";
    > }
    > return(s);
    > }
    > var str;
    > str = ShowFolderFileList('http://localhost/pdf'); or str =
    > ShowFolderFileList('/pdf');
    > ^^^^^^^^^^^^^^^ error at this string Path not found
    >
    > Response.Write(str);
    > %>
    > Thanks.
    > Stas.
    >
    >
     
    Lance Wynn, Jan 25, 2004
    #2
    1. Advertising

  3. I answered this in another group. Please don't multi-post.

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "Stas" <> wrote in message
    news:...
    > Hello All!
    > I found function for enumerate files in special folder and pasted in my

    asp
    > page, but Server generate error.
    > Who could tell me why server IIS 5.0 generate error, and how I must input
    > path for http://host/pdf?
    > <%
    > function ShowFolderFileList(folderspec)
    > {
    > var fso, f, f1, fc, s;
    > fso = new ActiveXObject("Scripting.FileSystemObject");
    > f = fso.GetFolder(folderspec);
    > fc = new Enumerator(f.files);
    > s = ""; for (; !fc.atEnd(); fc.moveNext())
    > {
    > s += fc.item();
    > s += "";
    > }
    > return(s);
    > }
    > var str;
    > str = ShowFolderFileList('http://localhost/pdf'); or str =
    > ShowFolderFileList('/pdf');
    > ^^^^^^^^^^^^^^^ error at this string Path not found
    >
    > Response.Write(str);
    > %>
    > Thanks.
    > Stas.
    >
    >
     
    Aaron Bertrand [MVP], Jan 25, 2004
    #3
    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. Mupota Muchelemba
    Replies:
    1
    Views:
    933
    Tony Morris
    Feb 4, 2004
  2. Replies:
    9
    Views:
    507
    Juan T. Llibre
    Dec 7, 2006
  3. Tomás Ó hÉilidhe

    Multi-threaded C programming (for those fond of portability)

    Tomás Ó hÉilidhe, Oct 29, 2008, in forum: C Programming
    Replies:
    14
    Views:
    510
  4. mynthon
    Replies:
    5
    Views:
    2,044
    krowey
    Feb 9, 2013
  5. dsh
    Replies:
    1
    Views:
    147
    Keith
    Feb 1, 2004
Loading...

Share This Page