Measuring File Sizes

Discussion in 'ASP General' started by Griff, Jun 10, 2005.

  1. Griff

    Griff Guest

    I've written an ASP file that queries a database and gets the full path to a
    database file, e.g.

    "C:\Program Files\Microsoft SQL Server\MSSQL\Data\myDatabase.mdf"

    I've then used the Scripting.FileSystemObject to identify the size of the
    file.

    oFSO.GetFile(sPath).Size

    It claims that the file does not exist....(when it definitely does!)

    I wondered whether this was to do with spaces in the file path, but I've
    proved that that is not the case.

    The EXACT code copied into a VB exe works fine.

    What's going on?

    Thanks

    Griff
    Griff, Jun 10, 2005
    #1
    1. Advertising

  2. Griff

    Curt_C [MVP] Guest

    Griff wrote:
    > I've written an ASP file that queries a database and gets the full path to a
    > database file, e.g.
    >
    > "C:\Program Files\Microsoft SQL Server\MSSQL\Data\myDatabase.mdf"
    >
    > I've then used the Scripting.FileSystemObject to identify the size of the
    > file.
    >
    > oFSO.GetFile(sPath).Size
    >
    > It claims that the file does not exist....(when it definitely does!)
    >
    > I wondered whether this was to do with spaces in the file path, but I've
    > proved that that is not the case.
    >
    > The EXACT code copied into a VB exe works fine.
    >
    > What's going on?
    >
    > Thanks
    >
    > Griff
    >
    >

    What user is IIS/ASP running under? It may not have permission to the
    file, or to the FSO object. Try some different tests with that and see
    what happens.


    --
    Curt Christianson
    site: www.darkfalz.com
    blog: blog.darkfalz.com
    Curt_C [MVP], Jun 10, 2005
    #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. Carlo Filippini

    Measuring performance of Net::FTP

    Carlo Filippini, Sep 9, 2003, in forum: Perl
    Replies:
    1
    Views:
    1,165
    Philip
    Sep 9, 2003
  2. Guadala Harry

    Measuring Memory Useage

    Guadala Harry, Oct 25, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    441
    bruce barker
    Oct 25, 2004
  3. Bill Cohagan

    Measuring serialized session "size"

    Bill Cohagan, Nov 24, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    632
    bruce barker
    Nov 25, 2004
  4. donbro
    Replies:
    2
    Views:
    533
    donbro
    Nov 1, 2005
  5. chris
    Replies:
    2
    Views:
    450
    chris
    Sep 19, 2007
Loading...

Share This Page