简体   繁体   中英

Read an xml file from different computer on the network?

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.

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"

只需将IIS应用程序池用户更改为“足够权限”用户(右键单击当前应用程序池-高级设置-身份),或在web.config的相同名称部分中指定模拟。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM