C# ASP.NET File.OpenRead from UNC path: "Access to path.....is denied."
I'm attempting to read a PDF from a UNC path, i.e. \10.32.16.24\repositories\repository0001\VOL00001\ktappb01_024655001_0.PDF
My virtual directory ASP.NET site is being run under IUSR_machine_name. Has anonymous access enabled as well.
I gave IUSR_machine_name full rights to the UNC share and as I step through my ASP.NET page's code behind onto the File.OpenRead(filepath) method, it throws an exception: "Access to path \10.32.16.24\repositories\repository0001\VOL00001\ktappb01_024655001_0.PDF is denied".
I tried granting the ASPNET user full rights to the share as well with the same result.
At this point I'm completely l开发者_JAVA技巧ost for a resolution.
I'm running IIS6.
On both machines security eventlog, check what user has been denied access. It is most likely a different user.
I was able to find the user by logging it. I'd made a stupid error in my code that wasn't giving me the result I was assuming I was going to get.
精彩评论