Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a ASP.NET web service access a network share?

Status
Not open for further replies.

StuckInTheMiddle

Programmer
Mar 3, 2002
269
US
Hi Guys,

I have a web service that takes a network address to a word doc as an input and it renames the document (using FileInfo.MoveTo) to something else (not really important).

This works great when the webservice is given a C:\ or e:\ drive path, but as soon as a UNC path to the same location is given ASP.NET protests 'Access to the path is denied.'

Now I know it's a permissions thing but the folder (setup as a FileShare) has full control given to the IIS_WPG user and the Network_service user which I thought would solve the UNC path problem. I just don't get what the difference between

e:\myfolder\myfile1.doc

AND

\\myserver\myfolder\myfile1.doc OR
\\myserver\e$\myfolder\myfile1.doc is?

I've tried giving permissions to these users (ASPNET, IUSR_myserver, IWAM__myserver) all with no luck, any ideas I cant really enforce the calling application to give me a e:\ instead of a UNC path,, grrr, this has been bugging me all day, I'm sure it's something simple that someone must have done before but couldn't find anything when googling for it.

A,

"If you can stay calm, while all around you is chaos...then you probably haven't completely understood the seriousness of the situation.
 
delegation needs to be configured between the local and remote server. browse the computers within AD. open the local (iis) server. one of the tabs should say delegation. select the server to delegate to and set the appropiate premissions.

(I'm assuming this is all contained within an intranet)

I use windows authentication on my web apps since they are all internal apps. if your using anonymous or forms authentication this may also effect the delegation.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks jmeckley for your comments. The issue turned out to be we had to give permissions to the 'fileshare' as well as permissions to the folder to 'Network Services'.

I didn't know in a server environment 'fileshare' permissions were needed, once that was done the application to save directly using the UNC path. Learn something knew everyday.

"If you can stay calm, while all around you is chaos...then you probably haven't completely understood the seriousness of the situation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top