DotNet98
DotNet98

Reputation: 747

Reading a file over the network from an mvc.net web application

Let's say I have deployed my mvc4.5 web app to Server1 in my network

Is there a way to access/read data from FileA.zzz that sits on Server2 in my Network from my mvc4.5 web application?

For example, in my Model, I want to read a file, by pointing to "x:\folder1\folder2\FileA.zzz"

x is a mapped drive that points to Server2

Currently I'm getting an error saying the file is not accessible

Thanks in Advance

Upvotes: 0

Views: 1194

Answers (1)

vmg
vmg

Reputation: 10576

enter image description hereYour web application uses application pool to run. Application pool has identity (user account that is used to run application.) You need to change identity of your application pool to user that has required permissions. By default your app will use default app pool. Use IIS Manager to update that.

Instruction about how to do it you can find here: http://msdn.microsoft.com/en-us/library/ee523018(v=bts.10).aspx Procedures

To configure the credentials for the default application pool 1. Click Start, then Settings, and click Control Panel.

  1. In Control Panel, double-click Administrative Tools.

  2. In Administrative Tools, double-click Internet Information Services (IIS) Manager.

  3. In Internet Information Services (IIS) Manager, expand (User account) and click Application Pools.

  4. Right-click DefaultAppPool and click Advanced Settings to display the Advanced Settings dialog box for the application pool.

  5. Modify the identity for the application pool by clicking the ellipsis (…) button next to Identity under the Process Model section of the Advanced Settings dialog box.

  6. In the Application Pool Identity dialog box, select the Custom Account option, click Set, and specify an account that has access to the BizTalk Server databases. Click OK until you exit the Advanced Settings dialog box.

Upvotes: 1

Related Questions