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

L

Lin Ma

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
 
A

Aaron [SQL Server MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top