Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   Accessing network file form ASP page (http://www.velocityreviews.com/forums/t798136-accessing-network-file-form-asp-page.html)

Lamberti Fabrizio 03-04-2005 01:17 PM

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.CreateObject("Scripting.fileSystemObject")
uri=\\web21bcklab\c$\Inetpub\wwwroot\WebModules\Lo gger\debugLog.txt
Response.Write fso.FileExists(uri)
---------------------

the existence check returns always false. why ?

How can I solve this problem ?

thx



Tom Kaminski [MVP] 03-04-2005 02:07 PM

Re: Accessing network file form ASP page
 
"Lamberti Fabrizio" <lambu@from_italy.it> wrote in message
news:OsVzIyLIFHA.1996@TK2MSFTNGP12.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.CreateObject("Scripting.fileSystemObject")
> uri=\\web21bcklab\c$\Inetpub\wwwroot\WebModules\Lo gger\debugLog.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



Thomas P. Skinner [MVP] 03-04-2005 02:20 PM

Re: Accessing network file form ASP page
 
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\filename.

Tom Skinner [ C# MVP]

"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:O86hROMIFHA.2956@TK2MSFTNGP12.phx.gbl...
> "Lamberti Fabrizio" <lambu@from_italy.it> wrote in message
> news:OsVzIyLIFHA.1996@TK2MSFTNGP12.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.CreateObject("Scripting.fileSystemObject")
>> uri=\\web21bcklab\c$\Inetpub\wwwroot\WebModules\Lo gger\debugLog.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
>
>




Lamberti Fabrizio 03-04-2005 02:25 PM

Re: Accessing network file form ASP page
 
It's the same with a public share.

I've already tried it

"Thomas P. Skinner [MVP]" <tom@bu.edu> wrote in message
news:enGU7TMIFHA.1860@TK2MSFTNGP15.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\filename.
>
> Tom Skinner [ C# MVP]
>
> "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
> news:O86hROMIFHA.2956@TK2MSFTNGP12.phx.gbl...
> > "Lamberti Fabrizio" <lambu@from_italy.it> wrote in message
> > news:OsVzIyLIFHA.1996@TK2MSFTNGP12.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.CreateObject("Scripting.fileSystemObject")
> >> uri=\\web21bcklab\c$\Inetpub\wwwroot\WebModules\Lo gger\debugLog.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
> >
> >

>
>




Tom Kaminski [MVP] 03-04-2005 02:52 PM

Re: Accessing network file form ASP page
 
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]" <tom@bu.edu> wrote in message
news:enGU7TMIFHA.1860@TK2MSFTNGP15.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\filename.
>
> Tom Skinner [ C# MVP]
>
> "Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
> news:O86hROMIFHA.2956@TK2MSFTNGP12.phx.gbl...
> > "Lamberti Fabrizio" <lambu@from_italy.it> wrote in message
> > news:OsVzIyLIFHA.1996@TK2MSFTNGP12.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.CreateObject("Scripting.fileSystemObject")
> >> uri=\\web21bcklab\c$\Inetpub\wwwroot\WebModules\Lo gger\debugLog.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
> >
> >

>
>




Aaron [SQL Server MVP] 03-04-2005 10:51 PM

Re: Accessing network file form ASP page
 
> 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



Lamberti Fabrizio 03-06-2005 09:08 AM

Re: Accessing network file form ASP page
 
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]" <ten.xoc@dnartreb.noraa> wrote in message
news:OgiT9yQIFHA.2136@TK2MSFTNGP14.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
>
>




Roland Hall 03-06-2005 12:16 PM

Re: Accessing network file form ASP page
 
"Lamberti Fabrizio" <lambu@from_italy.it> wrote in message
news:OsVzIyLIFHA.1996@TK2MSFTNGP12.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.CreateObject("Scripting.fileSystemObject")
: uri=\\web21bcklab\c$\Inetpub\wwwroot\WebModules\Lo gger\debugLog.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



Thomas P. Skinner [MVP] 03-06-2005 07:08 PM

Re: Accessing network file form ASP page
 
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_italy.it> wrote in message
news:u2sAgwiIFHA.2976@TK2MSFTNGP15.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]" <ten.xoc@dnartreb.noraa> wrote in message
> news:OgiT9yQIFHA.2136@TK2MSFTNGP14.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
>>
>>

>
>




Lamberti Fabrizio 03-06-2005 07:35 PM

Re: Accessing network file form ASP page
 
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?
>





All times are GMT. The time now is 06:51 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57