473,769 Members | 3,755 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check file exist without using Server.CreateOb ject("Scripting .FileSystemObje ct")

Greetings,

Is it possbile to check a file exist without using
Server.CreateOb ject("Scripting .FileSystemObje ct") 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.CreateOb ject("Scripting .FileSystemObje ct")
If objFSO.FileExis ts ("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 7125
> Is it possbile to check a file exist without using
Server.CreateOb ject("Scripting .FileSystemObje ct") in asp page??
If you have SQL Server on the box, you can use master..xp_file exist. 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*****@dnartr eb.noraa> wrote in message
news:uD******** ******@TK2MSFTN GP12.phx.gbl...
Is it possbile to check a file exist without using
Server.CreateOb ject("Scripting .FileSystemObje ct") in asp page??
If you have SQL Server on the box, you can use master..xp_file exist. 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
6694
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 specific routine to be skipped. I guess this is a simple If (that file exists) Open "C:\Temp\TU.tmp" For Input As #3 etc....... Else GoTo
5
2353
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 done wrong to the server. How can I fix the problem? Is there a way to resinstall the filesystemobject to the server? Thanks for any idea. -- Andrew
3
3448
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 which should open the other which is a simple text file - newText.txt . Here is readfile.asp : <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html>
2
18062
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 in C:\WINNT\System32 Sub Main() Dim fs As FileSystemObject
4
16559
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: Server object error 'ASP 0177 : 800401f3' Server.CreateObject Failed
1
2067
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 .ASP calling my .net dll breaks with Invalid class string to the browser. I find that I can fix a SP2 box by adding the IIS user to the permissed users for each .dll object in the registry. IE: regedt32, HKEY_CLASSES_ROOT.your_dll_class
1
9425
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 move the logic to the next instance in the loop (again, testing if the URL path exists). I have a check_path function for these cases with the following code: var oFSO = new ActiveXObject("Scripting.FileSystemObject");
3
7637
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' Path not found Here is my code <% dim fs,fo,x set fs=Server.CreateObject("Scripting.FileSystemObject")
7
6465
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 excpet for 1. When i was using it prompt this error: "License information for this component not found. You do not have an appropriate license to use this functionality in the design environment"
0
9583
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6668
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5297
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5445
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3955
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3560
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.