stighy
stighy

Reputation: 7170

Asp.NET: How to send files located in a share

I'm developing an ASP.NET (webforms) web application only for our intranet company. I've a network share / repository, say Z:\MyRepository\ , obviously outside c:\inetpub\wwwroot.

I need to "serve" these files from my web application.

My question is:

  1. Which permissions I need to add to Z:\MyRepository\ . IIS_USR ? Others ?

  2. How to send file ? Using Response.Transmit ?

Thanks

Upvotes: 0

Views: 188

Answers (1)

Craig H
Craig H

Reputation: 2071

Normally the app pool user which your application is running under will be the user which needs access on the file share.

To simplify things in your application, you could also create a virtual directory in IIS and map it to the file share. This has a number of advantages, but mainly:

  • It makes it simpler to reference files from within the application.
  • If the network path changes, you only need to update your virtual directory.
  • You can also specify a different user for the virtual directory to use.

Upvotes: 2

Related Questions