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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Service that reads File From Network

Status
Not open for further replies.

notrut

Programmer
Feb 6, 2002
87
CA
Hi,

I have created a web service that reads a file from a network folder. The web service works fine when I consume it locally, however when I deploy the web service to a server I get the following error:

Server was unable to process request. ---> Could not find file '\\server\D$\test1.pdf'.

I believe it has something to do with permissions, however the network credentials that are running the web service have full access to the network folder.

The piece of code that fails is:

Dim fileContents As Byte() = File.ReadAllBytes(fileLocation)

Am I doing something wrong?

Any help would greatly be appreciated.

Thanks,

 
Solved it:

- Had to set the app pool to run under the account that has access to the folder in IIS
- had to give that account read and list dir to C:\Windows\Temp folder on server
- had to add that account to the IIS_WPG on the server
- add to make sure the impersonate tag in the web.config was set to false.

Then everything was golden!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top