473,727 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing network file form ASP page

Hi all,
I've to access to a network file from an asp pages.

I've red a lot of things on old posts and on Microsoft article but I can't
still solve my problem.

I've got two server inside the same NT domain, each one has its own web
server.

The web server is always IIS 5.0.

One of this web server have to access to a network file in writing mode
inside the other server.

I've tried using this code
-------------------
Set fso = Server.CreateOb ject("Scripting .fileSystemObje ct")
uri=\\web21bckl ab\c$\Inetpub\w wwroot\WebModul es\Logger\debug Log.txt
Response.Write fso.FileExists( uri)
---------------------

the existence check returns always false. why ?

How can I solve this problem ?

thx
Jul 22 '05 #1
23 2903
"Lamberti Fabrizio" <lambu@from_ita ly.it> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl...
Hi all,
I've to access to a network file from an asp pages.

I've red a lot of things on old posts and on Microsoft article but I can't
still solve my problem.

I've got two server inside the same NT domain, each one has its own web
server.

The web server is always IIS 5.0.

One of this web server have to access to a network file in writing mode
inside the other server.

I've tried using this code
-------------------
Set fso = Server.CreateOb ject("Scripting .fileSystemObje ct")
uri=\\web21bckl ab\c$\Inetpub\w wwroot\WebModul es\Logger\debug Log.txt
Response.Write fso.FileExists( uri)
---------------------

the existence check returns always false. why ?

How can I solve this problem ?


http://www.aspfaq.com/show.asp?id=2168

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
Jul 22 '05 #2
He is not trying to access an Access file but rather a text file. I think
the problem is using an administrative share. c$, rather than a public
share.

Set up a public share on the directory containing the file, e.g., pubdir,
and access it as \\pubdir\filena me.

Tom Skinner [ C# MVP]

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:O8******** ******@TK2MSFTN GP12.phx.gbl...
"Lamberti Fabrizio" <lambu@from_ita ly.it> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl...
Hi all,
I've to access to a network file from an asp pages.

I've red a lot of things on old posts and on Microsoft article but I
can't
still solve my problem.

I've got two server inside the same NT domain, each one has its own web
server.

The web server is always IIS 5.0.

One of this web server have to access to a network file in writing mode
inside the other server.

I've tried using this code
-------------------
Set fso = Server.CreateOb ject("Scripting .fileSystemObje ct")
uri=\\web21bckl ab\c$\Inetpub\w wwroot\WebModul es\Logger\debug Log.txt
Response.Write fso.FileExists( uri)
---------------------

the existence check returns always false. why ?

How can I solve this problem ?


http://www.aspfaq.com/show.asp?id=2168

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running
IIS

Jul 22 '05 #3
It's the same with a public share.

I've already tried it

"Thomas P. Skinner [MVP]" <to*@bu.edu> wrote in message
news:en******** ******@TK2MSFTN GP15.phx.gbl...
He is not trying to access an Access file but rather a text file. I think
the problem is using an administrative share. c$, rather than a public
share.

Set up a public share on the directory containing the file, e.g., pubdir,
and access it as \\pubdir\filena me.

Tom Skinner [ C# MVP]

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:O8******** ******@TK2MSFTN GP12.phx.gbl...
"Lamberti Fabrizio" <lambu@from_ita ly.it> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl...
Hi all,
I've to access to a network file from an asp pages.

I've red a lot of things on old posts and on Microsoft article but I
can't
still solve my problem.

I've got two server inside the same NT domain, each one has its own web
server.

The web server is always IIS 5.0.

One of this web server have to access to a network file in writing mode
inside the other server.

I've tried using this code
-------------------
Set fso = Server.CreateOb ject("Scripting .fileSystemObje ct")
uri=\\web21bckl ab\c$\Inetpub\w wwroot\WebModul es\Logger\debug Log.txt
Response.Write fso.FileExists( uri)
---------------------

the existence check returns always false. why ?

How can I solve this problem ?


http://www.aspfaq.com/show.asp?id=2168

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running
IIS


Jul 22 '05 #4
Yes - but the procedure provided by Aaron is the same.

Good point about the share - C$ is only available to admins.

"Thomas P. Skinner [MVP]" <to*@bu.edu> wrote in message
news:en******** ******@TK2MSFTN GP15.phx.gbl...
He is not trying to access an Access file but rather a text file. I think
the problem is using an administrative share. c$, rather than a public
share.

Set up a public share on the directory containing the file, e.g., pubdir,
and access it as \\pubdir\filena me.

Tom Skinner [ C# MVP]

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:O8******** ******@TK2MSFTN GP12.phx.gbl...
"Lamberti Fabrizio" <lambu@from_ita ly.it> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl...
Hi all,
I've to access to a network file from an asp pages.

I've red a lot of things on old posts and on Microsoft article but I
can't
still solve my problem.

I've got two server inside the same NT domain, each one has its own web
server.

The web server is always IIS 5.0.

One of this web server have to access to a network file in writing mode
inside the other server.

I've tried using this code
-------------------
Set fso = Server.CreateOb ject("Scripting .fileSystemObje ct")
uri=\\web21bckl ab\c$\Inetpub\w wwroot\WebModul es\Logger\debug Log.txt
Response.Write fso.FileExists( uri)
---------------------

the existence check returns always false. why ?

How can I solve this problem ?


http://www.aspfaq.com/show.asp?id=2168

--
Tom Kaminski IIS MVP
http://www.microsoft.com/windowsserv...y/centers/iis/
http://mvp.support.microsoft.com/
http://www.iistoolshed.com/ - tools, scripts, and utilities for running
IIS


Jul 22 '05 #5
> He is not trying to access an Access file but rather a text file.

The problem is still the same. IUSR cannot touch a text for the same
reasons it can't touch an MDB file... the other machine doesn't know who he
is!
I think the problem is using an administrative share. c$, rather than a public share.


Yes, this definitely part of the problem. The only way you could have C$ be
used is if you add WebServer\IUSR_ WebServer to the local admin group on the
server web21bcklab ... not exactly a recommended approach, but I guess it
depends on the environment. I'd prefer to have public shares explicitly
granted access than suddenly give IUSR carte blanche over the whole server.

A
Jul 22 '05 #6
Your solution is formally correct but it's doesn't solve completly my
problem.

I've an asp file inside a virtual directory with necessary only Windows
Integrated Authentication enabled. That file have to access to text file
inside another host member of the same NT domain.

The authentication inside asp file is made only with domain user. By this
domain users I can manually access to tha text file, but my web server can
not.

Does my web server always access to text file on network share only by using
IUSR_webserver user ?

"Aaron [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:Og******** ******@TK2MSFTN GP14.phx.gbl...
He is not trying to access an Access file but rather a text file.
The problem is still the same. IUSR cannot touch a text for the same
reasons it can't touch an MDB file... the other machine doesn't know who

he is!
I think the problem is using an administrative share. c$, rather than a public
share.


Yes, this definitely part of the problem. The only way you could have C$

be used is if you add WebServer\IUSR_ WebServer to the local admin group on the server web21bcklab ... not exactly a recommended approach, but I guess it
depends on the environment. I'd prefer to have public shares explicitly
granted access than suddenly give IUSR carte blanche over the whole server.
A

Jul 22 '05 #7
"Lamberti Fabrizio" <lambu@from_ita ly.it> wrote in message
news:Os******** ******@TK2MSFTN GP12.phx.gbl...
: Hi all,
: I've to access to a network file from an asp pages.
:
: I've red a lot of things on old posts and on Microsoft article but I can't
: still solve my problem.
:
: I've got two server inside the same NT domain, each one has its own web
: server.
:
: The web server is always IIS 5.0.
:
: One of this web server have to access to a network file in writing mode
: inside the other server.
:
: I've tried using this code
: -------------------
: Set fso = Server.CreateOb ject("Scripting .fileSystemObje ct")
: uri=\\web21bckl ab\c$\Inetpub\w wwroot\WebModul es\Logger\debug Log.txt
: Response.Write fso.FileExists( uri)
: ---------------------
:
: the existence check returns always false. why ?
:
: How can I solve this problem ?

How often does it need to be accessed and how updated does the data need to
be?

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #8
It's not the web server, but rather the ISAPI extension. In this case
ASP.dll. ASP.NET doesn't run under IUSR_server, but rather under the account
ASPNET on XP Pro and under NETWORK on WS3 if I recall correctly. With
ASP.NET there are ways of impersonating a user and therefore any actions by
that user would have that users security token. Unfortunately I don't think
there is any way to do this under ASP other than writing your own ISAPI
extension. You are probably stuck with IUSR_server credentials. I might be
wrong though. Personally I would switch to ASP.NET.

You can always put this file in its own directory and make it a public
writable share and then your server could access it regardless of
authentication credentials. Of course this offers no protection.

Tom Skinner [C# MVP]
"Lamberti Fabrizio" <lambu@from_ita ly.it> wrote in message
news:u2******** ******@TK2MSFTN GP15.phx.gbl...
Your solution is formally correct but it's doesn't solve completly my
problem.

I've an asp file inside a virtual directory with necessary only Windows
Integrated Authentication enabled. That file have to access to text file
inside another host member of the same NT domain.

The authentication inside asp file is made only with domain user. By this
domain users I can manually access to tha text file, but my web server can
not.

Does my web server always access to text file on network share only by
using
IUSR_webserver user ?

"Aaron [SQL Server MVP]" <te*****@dnartr eb.noraa> wrote in message
news:Og******** ******@TK2MSFTN GP14.phx.gbl...
> He is not trying to access an Access file but rather a text file.


The problem is still the same. IUSR cannot touch a text for the same
reasons it can't touch an MDB file... the other machine doesn't know who

he
is!
> I think the problem is using an administrative share. c$, rather than a

public
> share.


Yes, this definitely part of the problem. The only way you could have C$

be
used is if you add WebServer\IUSR_ WebServer to the local admin group on

the
server web21bcklab ... not exactly a recommended approach, but I guess it
depends on the environment. I'd prefer to have public shares explicitly
granted access than suddenly give IUSR carte blanche over the whole

server.

A


Jul 22 '05 #9
I can't understand why you want to know this kind of information.

That file could be access a lot of time in some days and just a few in other
ones

How often does it need to be accessed and how updated does the data need to be?

Jul 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
16404
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC path with a FSO: Set myFile = Server.CreateObject("Scripting.FileSystemObject").GetFile("\\server2\myshare\myfile.txt") this fails with an Permission Denied. here's the deal:
1
6690
by: TJRobertsJob | last post by:
Was wondering if someone could help. Over the last month I've been developing a small database application, using Access 2000, for use in a friends shop. Everything was going well until about a week ago when I started getting the following error when I would click any buttons on my main form that ran either VB code or an Access Macro: "Error accessing file. Network connection may have been lost.". I know for sure it's not a network...
1
1150
by: JP | last post by:
Hi, I want to import a few Excel Sheets from a network drive (e.g. F:\, some file server). The way it works right now is I have a 'File Watcher' that picks up the files as soon as they are available and dumps them into the Web Server and then the Web Service 'File Importer' on the same Web Server imports them into the database. I would like to trigger the import with a 'Click' event
1
1491
by: Yama | last post by:
Hi Is there a way using an Intranet ASP.NET web application to access a text file from a specified folder The Logic ReadTextFile.asp ------------------- FILE = "a_comma_delimited_text_file.txt PATH = "C:\folder\subfolder\
2
6063
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet server. On the line: dirs = Directory.GetDirectories(currentDir) I get "Access to the path "\\les-net\les\Special Projects\ATSPDF" is denied." How do I get the GetDirectories command to user my user ID and password when it tries to hit the...
0
2264
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization involves reading and writing some text and xml files using simple streamreader and streamwriter...
3
5003
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
0
12085
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the likelihood of CRM success from less than 20 percent to 60 percent. WHITEPAPER :
1
3945
by: Donald Grove | last post by:
I am suddenly getting this message. It happens during code executed from a form module that calls a function stored in a standard module. I am working on a standalone pc with no network connection to anything. After this message, access closes. Then when I go back, all the module have been deleted from the form.\ MS error reporting sends me to a web page that says there isn't a fix for the problem and that I should get Access 2003 (I...
0
8891
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
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9406
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...
1
9185
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8103
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
6703
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
6011
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();...
3
2158
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.