![]() |
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 |
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 |
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 > > |
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 > > > > > > |
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 > > > > > > |
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 |
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 > > |
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 |
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 >> >> > > |
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.