By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,995 Members | 1,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,995 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
> 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

P: n/a
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.