1

Similar: IIS AppPoolIdentity and file system write access permissions

I'm working with an MVC3 IIS Application where the user should be able to upload images (not to a database, but to the Local File System) and have these images displayed (something of a profile picture kind of system).

The problem I'm having is that there's a so-called load balancer in between the user and application meaning our users will get to either let's call them [Web 1]:192.168.0.1 and [Web 2]:192.168.0.2.

So obviously in order for this feature to be useful if we were to host the images on [Web 1]'s LFS, [Web 2] would need to access it.

So far I've tried the paths;

  • \\192.168.0.1\c$\etc...\images
  • \\[Web 1]\images

For testing, I've added 'Everyone' with Full Control to the \images\ directory, however when my application has no luck with read of write access to the remote system.

Additional notes:

  • [Web 1] and [Web 2] are not on the same domain, they are both independent
  • The [Web 2] user in the application pool is the [ApplicationPoolIdentity]

If any more information is required, please don't hesitate to let me know.

Community
  • 1
  • 1
alexander.teno
  • 109
  • 1
  • 11

2 Answers2

0

Why don't you store your images in a third server which Web1 and Web2 will access? I found an useful topic in here: Access to the path is denied

Community
  • 1
  • 1
Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
  • I've thought about that, but I can access the UNC path and Fileshare through the system, after providing credentials, so I'm not sure that's the best solution. I'll try to do some more research on this (since it'll likely be my fallback) – alexander.teno Aug 24 '12 at 15:01
  • You could also just always access the file local, and then just have a job that keeps the two server's local directory in sync (robocopy can do that I believe) – Stephen S. Aug 24 '12 at 16:56
  • What about host an WCF in IIS and let it access your local resources and expose to your web apps? – Thiago Custodio Aug 24 '12 at 18:14
0

I encountered this problem while developing on my local workstation.

After several unsuccessful iisreset invocations, I remedied this situation by rebooting my machine.

In retrospect, an open file handle may have been causing issues.

Jim G.
  • 15,141
  • 22
  • 103
  • 166