473,806 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.tx t 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 4750
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*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP04.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.tx t 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.comwrot e in message
news:Oe******** ******@TK2MSFTN GP02.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*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP04.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.tx t 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*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP04.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.comwrot e in message
news:Oe******** ******@TK2MSFTN GP02.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*******@hotm ail.comwrote in message
news:%2******* *********@TK2MS FTNGP04.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.tx t 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.comwrot e in message
news:uj******** ******@TK2MSFTN GP05.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*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP04.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.comwrot e in message
news:Oe******* *******@TK2MSFT NGP02.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*******@hotm ail.comwrote in message
news:%2****** **********@TK2M SFTNGP04.phx.gb l...
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.tx t 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="tr ue" userName="Redmo nd\BillG" password="Melin da"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP04.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.tx t 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.netw rote in
message news:D9******** *************** ***********@mic rosoft.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="tr ue" userName="Redmo nd\BillG" password="Melin da"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotm ail.comwrote in message
news:%2******** ********@TK2MSF TNGP04.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.tx t 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="tr ue" userName="Serve rA\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*******@hotm ail.comwrote in message
news:uB******** ******@TK2MSFTN GP03.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.netw rote in message
news:D9******** *************** ***********@mic rosoft.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="tr ue" userName="Redmo nd\BillG" password="Melin da"/>

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Speech Lover" <vi*******@hotm ail.comwrote in message
news:%2******* *********@TK2MS FTNGP04.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.tx t 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
5949
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 in Visual Studio to create reports and labels as it's in Access?` The advantage of VS.net is that not every user needs Access, right? And that would eliminate the Access version problem as well I guess.
7
2046
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 access. The 2nd part is for our staff to access only. My director hopes to make the 2nd part to be something like an intranet, such that only our company's computers (maybe only 1 or 2 in the company) can login to this part of the application. 1. My...
20
3353
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 speed. I like books with practical exercises, and also with test questions (like cert books) *2*
35
3228
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 = 2,048,000k Let's say on average each record in the database consumes 15k 2,048,000/15 = 136,533 records
5
2973
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 use the DB2 Governor to do this, but it seems it always allows the the first query to be processed before forcing the connection. Here is my db2gov config file: --- start config
6
1693
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 the same app locally installed (C Drive) Can someone help me with the 'Catch' part of this code in VB.NET? Pseudo code
15
4651
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 communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
22
6294
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 client (MS Access vs ..NET Windows Forms) would be preferred over the other. While I have some good arguments on both sides, I would appreciate your points of view on the topic.
17
4425
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 there, but is there a way they can find out if that application was put there from a CD or email or created at work? Hint: It's not on a client/server database, just native jet database mdb created on Access 2003 (default 2000)...
0
2763
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 product) to install my applications. When the Access Runtime was needed on the system I simply ran 'accessrt.msi' from Microsoft Office Developer discs. When another version of Access (other than Access 2002) was on the system then I simply...
0
9599
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
10371
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
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,...
1
7650
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
6877
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
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
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
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
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.