0

To begin with, I developed a web application which reads an XML file from specific location and displays the contents on editable web page of the application,which is executed perfectly when the XML file is on the same machine/computer. When I try to read the same file on different computer on the network I cannot read the contents onto my web page.

My Observation: When I access that file from run window in the computer by entering \xxx.xxx.xx.xx\c$ it gives me the window to connect to the machine asking for credentials and I guess the session is open. So I close the window and when I access the xml file from the web application it's able to read the content.

Is there a way to bypass this authentication mechanism which is part of windows when I use my web app to read the XML file or is there a way to accommodate the extra step to configure the authentication in my application?

I would be glad if someone can guide me to the solution.

Peter
  • 13,733
  • 11
  • 75
  • 122
Macnique
  • 1,028
  • 2
  • 19
  • 44
  • Possible solution here: http://stackoverflow.com/questions/278132/asp-net-impersonate-against-a-domain-on-vmware – Martin Jul 18 '12 at 13:52
  • Please share the code you're using to read the file and the error you receive. – MNGwinn Jul 18 '12 at 15:23

3 Answers3

0

Check the user your web application is running under and if this user is also permitted to access this location.

If you are using IIS to host the page you have to check the "AppPool" user and also the users which are used at the "Web Site" and "Application"

Dominik Kirschenhofer
  • 1,205
  • 1
  • 13
  • 27
  • :I already did impersonate the user which i am using and which has access to that location.since i am using IISv5.1 is there an option for AppPool ??? – Macnique Jul 18 '12 at 14:28
  • I am impersonating the user in my web.config file and this user has access to that location on other computer. – Macnique Jul 18 '12 at 14:32
0

Just change IIS application pool user to "enough rights" user (right click current app pool - advanced settings - identity) or specify impersonation in the same name section in web.config.

Denis Agarev
  • 1,531
  • 4
  • 17
  • 34
0

Could it be possible to change your logic,

By storing file from different network to local machine where your code is running, through uploading file and process it.

PMegh
  • 49
  • 1