468,769 Members | 1,978 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,769 developers. It's quick & easy.

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

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


Jul 19 '05 #1
2 6832
> 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.)
Jul 19 '05 #2
Thanks Aaron. You always give me the right direction.

Have a blessing day.

Lin

"Aaron [SQL Server MVP]" <te*****@dnartreb.noraa> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
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.)

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jason Charalambides | last post: by
2 posts views Thread by Stavros | last post: by
7 posts views Thread by Benjamins via AccessMonster.com | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.