473,385 Members | 1,730 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,385 software developers and data experts.

How to access UNC from ASP.NET application?

I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other
machine.

any idea?

thanks,
Vince
Apr 19 '07 #1
7 4737
re:
Note that I have allowed Full Control permission on abc.txt on the other machine.
To which account have you allowed full permissions to ?
To the ASP.NET account which is accessing the UNC file ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>I have problem writing content to a UNC file from my ASP.NET 1.1 application. This is on Windows
server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other machine.

any idea?

thanks,
Vince

Apr 19 '07 #2
Say we have two servers: A & B.
On B, I do
1. Right click on C:\SharedFolder and share it out
2. Under Sharing - Permissions, I allow Everyone to have Full Control
3. Under Security, I adde an object Server-B\ASPNET and allow Full Control
to it. (I wanted to allow Server-A\ASPNET but can't change the location to
Server-A)

Then on A, I map X: drive to Server-B\SharedFolder and have my ASP.NET code
to write to X:\
I also tried using \\Server-B\SharedFolder but got the same problem.

Any comments are more than welcome

thanks,
Speech Lover

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
re:
>Note that I have allowed Full Control permission on abc.txt on the other
machine.

To which account have you allowed full permissions to ?
To the ASP.NET account which is accessing the UNC file ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other
machine.

any idea?

thanks,
Vince


Apr 19 '07 #3
re:
3. Under Security, I adde an object Server-B\ASPNET and allow Full Control to it. (I wanted to
allow Server-A\ASPNET but can't change the location to Server-A)
The problem is that the account which is accessing B's C:\SharedFolder
is the one which needs access permissions.

If you can't grant access permissions on B's C:\SharedFolder to the A account
which ASP.NET is running as, ASP.NET will not be able to access that resource.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
Say we have two servers: A & B.
On B, I do
1. Right click on C:\SharedFolder and share it out
2. Under Sharing - Permissions, I allow Everyone to have Full Control
3. Under Security, I adde an object Server-B\ASPNET and allow Full Control to it. (I wanted to
allow Server-A\ASPNET but can't change the location to Server-A)

Then on A, I map X: drive to Server-B\SharedFolder and have my ASP.NET code to write to X:\
I also tried using \\Server-B\SharedFolder but got the same problem.

Any comments are more than welcome

thanks,
Speech Lover

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
>re:
>>Note that I have allowed Full Control permission on abc.txt on the other machine.

To which account have you allowed full permissions to ?
To the ASP.NET account which is accessing the UNC file ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>>I have problem writing content to a UNC file from my ASP.NET 1.1 application. This is on Windows
server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other machine.

any idea?

thanks,
Vince



Apr 19 '07 #4
I am just a newbie to networking.
From Server-B, I open up Network Places and I am able to see both Server-A
and Server-B under the same WORKGROUP.
I click on "Locations..." but I don't see Server-A there. Nor can I click
and browse a different location.

Could you tell me what I need to do to allow me to select a different server
from "Locations.."?

Many Thanks!
Speech Lover
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:uj**************@TK2MSFTNGP05.phx.gbl...
re:
>3. Under Security, I adde an object Server-B\ASPNET and allow Full
Control to it. (I wanted to allow Server-A\ASPNET but can't change the
location to Server-A)

The problem is that the account which is accessing B's C:\SharedFolder
is the one which needs access permissions.

If you can't grant access permissions on B's C:\SharedFolder to the A
account
which ASP.NET is running as, ASP.NET will not be able to access that
resource.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Say we have two servers: A & B.
On B, I do
1. Right click on C:\SharedFolder and share it out
2. Under Sharing - Permissions, I allow Everyone to have Full Control
3. Under Security, I adde an object Server-B\ASPNET and allow Full
Control to it. (I wanted to allow Server-A\ASPNET but can't change the
location to Server-A)

Then on A, I map X: drive to Server-B\SharedFolder and have my ASP.NET
code to write to X:\
I also tried using \\Server-B\SharedFolder but got the same problem.

Any comments are more than welcome

thanks,
Speech Lover

"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
>>re:
Note that I have allowed Full Control permission on abc.txt on the
other machine.

To which account have you allowed full permissions to ?
To the ASP.NET account which is accessing the UNC file ?

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl.. .
I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the
other machine.

any idea?

thanks,
Vince



Apr 19 '07 #5
I suggest you use impersonation to have ASP.NET run under a different user
account that has the necessary network access.
At first, for testing purposes, I'd suggest you have it run under your user
account since you know you have the required access to the folder.

<!-- Web.config file. -->
<identity impersonate="true" userName="Redmond\BillG" password="Melinda"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other
machine.

any idea?

thanks,
Vince
Apr 19 '07 #6
Hi Steve,

Let me tell you more details:

A small WORKGROUP has two Windows Server 2003 servers - server A & server B.
I have installed an application on server A and by default it runs under
the
account "Network Service".
This application writes files to a local directory without any problem but
when
I use UNC format to write files to server B, it fails.

Note that on server B I have also granted full control permission to
account
"Network Service".

What needs to be done to allow "Network Service" account to write to a
network shared folder?

In WORKGROUP environment, shouldn't "Network Service" account on both
two servers take care of the authenticaion issue?

thanks,
Vince
"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in
message news:D9**********************************@microsof t.com...
>I suggest you use impersonation to have ASP.NET run under a different user
account that has the necessary network access.
At first, for testing purposes, I'd suggest you have it run under your
user account since you know you have the required access to the folder.

<!-- Web.config file. -->
<identity impersonate="true" userName="Redmond\BillG" password="Melinda"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>I have problem writing content to a UNC file from my ASP.NET 1.1
application. This is on Windows server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other
machine.

any idea?

thanks,
Vince

Apr 19 '07 #7
Network Service is an account *local* to the W2K3 server.
Its identity isn't usable by other servers.

IOW, server A's "Network Service" account is local to Server A,
and cannot access Server B's shared folder.

re:
!In WORKGROUP environment, shouldn't "Network Service" account on both
!two servers take care of the authenticaion issue?

No. They are different accounts, local to each server.

Setup a user account on server A and, as Steve suggests,
impersonate that user and give that account access permissions to the shared folder.

As Steve suggested, write this entry in web.config :
<!-- Web.config file. -->

<identity impersonate="true" userName="ServerA\Accountname" password="pass"/>

Here's the instructions to create the service account :
http://msdn2.microsoft.com/en-us/library/ms998297.aspx

To be on the safe side, verify that the following ACLs have been set on Server A:
http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Speech Lover" <vi*******@hotmail.comwrote in message
news:uB**************@TK2MSFTNGP03.phx.gbl...
Hi Steve,

Let me tell you more details:

A small WORKGROUP has two Windows Server 2003 servers - server A & server B.
I have installed an application on server A and by default it runs under the
account "Network Service".
This application writes files to a local directory without any problem but when
I use UNC format to write files to server B, it fails.

Note that on server B I have also granted full control permission to account
"Network Service".

What needs to be done to allow "Network Service" account to write to a
network shared folder?

In WORKGROUP environment, shouldn't "Network Service" account on both
two servers take care of the authenticaion issue?

thanks,
Vince
"Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <St***@Orr.netwrote in message
news:D9**********************************@microsof t.com...
>>I suggest you use impersonation to have ASP.NET run under a different user account that has the
necessary network access.
At first, for testing purposes, I'd suggest you have it run under your user account since you
know you have the required access to the folder.

<!-- Web.config file. -->
<identity impersonate="true" userName="Redmond\BillG" password="Melinda"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>>I have problem writing content to a UNC file from my ASP.NET 1.1 application. This is on Windows
server 2003
The event log says "X:\temp\abc.txt path not found" and stuff.

Note that I have allowed Full Control permission on abc.txt on the other machine.

any idea?

thanks,
Vince


Apr 19 '07 #8

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

Similar topics

63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
7
by: wrytat | last post by:
Hi! I'm very new to ASP.NET and really need some good advice from experts here. I'm creating a web application for my company now. This application has 2 parts. 1 part for the customers to...
20
by: Olav.NET | last post by:
I am a .NET/C++ developer who is supposed to do some work with Access. I do not know much about it except for the DB part. Questions: *1* I am looking for INTENSIVE books to get quickly up to...
35
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 =...
5
by: toddles666 | last post by:
Hi- Is there any way of restricting access to a database by application & account? For example, I only want the application APP1 to access the database using the USER1 account. I've tried to...
6
by: jonefer | last post by:
I have two versions of a 'Downtime Application that will run in the event that the mainframe goes down 1) SQL Server ASP.NET app (accessed outside the mainframe network) 2) MS Access Version of...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
22
by: Jordan S. | last post by:
SQL Server will be used as the back-end database to a non trivial client application. In question is the choice of client application: I need to be able to speak intelligently about when one...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
0
by: Sebastian | last post by:
Hello I develop my applications in Access 2002. My development system is running Windows XP SP2 and I have Microsoft Office XP Developer. Microsoft Office XP is at SP3. I used Inno Setup (great...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.