473,395 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 7083
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jason Charalambides | last post by:
I set a program to automatically load values from a temporary file. However, there is a chance that the specific temporary file "C:\Temp\TU.tmp" may not exist at all. In that case I want that...
5
by: Andrew | last post by:
Hi, experts, My system has a problem when I invoke the fileSystemObject to create a text file (it worked ok long before.) The asp seems running, but actually never finishes. I don't know what I...
3
by: bt | last post by:
I am just beginning with asp and have gotten an error that I need some help with. I posted a pair of files to an online ASP host server. The files are in the same directory; one is readfile.asp...
2
by: Stavros | last post by:
Hi all when I execute the following VB6 code in Windows 2000 and as an Administrator, everything is working fine. Project->References->"Microsoft Scripting Runtime" and scrrun.dll is located...
4
by: MoF | last post by:
Hello! I have for a long time used the line: Set FS=Server.CreateObject("Scripting.FileSystemObject") in my ASP code. Suddenly one day this week it stopped working and I now get the error: ...
1
by: chsmith | last post by:
I'm calling a .net / c# .dll from .ASP via Server.CreateObject(). I regasm, gacutil /i and all runs fine on XP SP1 or older. SP2 registry subracts System (??) from the registry root nodes and...
1
by: pbd22 | last post by:
Hi - I have code that automatically fills tabs on a page. In some cases, a URL path won't be correct (the folder and files don't exist) and, in these cases, I want to catch these exceptions and...
3
by: =?Utf-8?B?VG9kZA==?= | last post by:
trying to access files located on another server within the network. the folder is shared out and we created a virtual directory as well. The error is Microsoft VBScript runtime error '800a004c'...
7
by: Benjamins via AccessMonster.com | last post by:
Hi, I have meet a problem for CreateObject("Scripting.FileSystemObject"). I uses this code to get the information of the harddisk I have 10 user using the same code. All where working fine...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.