Check file exist without using Server.CreateObject("Scripting.FileSystemObject")

Discussion in 'ASP General' started by Lin Ma, Jun 10, 2004.

  1. Lin Ma

    Lin Ma Guest

    Greetings,

    Is it possbile to check a file exist without using
    Server.CreateObject("Scripting.FileSystemObject") in asp page??

    The reason is our hosting company turn that function off for security
    reason.

    Here is my original code:
    <%
    Dim objFSO
    Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
    If objFSO.FileExists ("yourfile.txt") Then
    Response.Write "File exists"
    Else
    Response.Write "File does not exist"
    End If
    %>

    Thanks a lot.

    Lin
     
    Lin Ma, Jun 10, 2004
    #1
    1. Advertising

  2. > Is it possbile to check a file exist without using
    > Server.CreateObject("Scripting.FileSystemObject") in asp page??


    If you have SQL Server on the box, you can use master..xp_fileexist. Or
    maybe on error resume next and server.execute or something like that. But
    generally, no.

    > The reason is our hosting company turn that function off for security
    > reason.


    Switch hosts. They're acting like Rain Man only wanting to fly Qantas, and
    most other hosts allow this functionality because they know how to manage
    it.

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)
     
    Aaron [SQL Server MVP], Jun 10, 2004
    #2
    1. Advertising

  3. Lin Ma

    Lin Ma Guest

    Thanks Aaron. You always give me the right direction.

    Have a blessing day.

    Lin

    "Aaron [SQL Server MVP]" <> wrote in message
    news:...
    > > Is it possbile to check a file exist without using
    > > Server.CreateObject("Scripting.FileSystemObject") in asp page??

    >
    > If you have SQL Server on the box, you can use master..xp_fileexist. Or
    > maybe on error resume next and server.execute or something like that. But
    > generally, no.
    >
    > > The reason is our hosting company turn that function off for security
    > > reason.

    >
    > Switch hosts. They're acting like Rain Man only wanting to fly Qantas,

    and
    > most other hosts allow this functionality because they know how to manage
    > it.
    >
    > --
    > http://www.aspfaq.com/
    > (Reverse address to reply.)
    >
    >
     
    Lin Ma, Jun 10, 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. Replies:
    1
    Views:
    2,720
  2. Andrew
    Replies:
    5
    Views:
    174
    Bob Barrows [MVP]
    Jun 15, 2004
  3. MoF
    Replies:
    4
    Views:
    498
  4. Todd
    Replies:
    1
    Views:
    430
  5. ashish
    Replies:
    1
    Views:
    448
    ashish
    Aug 14, 2007
Loading...

Share This Page