In my asp.net application, I’m trying to save a file in a different directory but on the same server and I keep getting a “Access to the path ‘\\12.34.56.78\d$\blah\subdomains\static\httpdocs\images\upload’ is denied.
Both sites run under the same application pool on IIS7. I’ve added modify permissions on the Images folder for IUSR and Network Service and no change. I also added Full control for Everyone on that folder, but still nothing.
Is there something else I need to amend when uploading files to a location on the server that sits outwith the website? Would FTP be a better solution?
Thanks
EDIT Retrying this answer as the original was on a phone and almost unintelligible.
The path you are providing indicates you are trying to create folders and files via UNC path names within your application. This is not advisable. Typically, only members of a local or domain administrators group are going be authorized to access anything through that administrative share, meaning that permission tweaks to lower-level folders won’t solve the problem if the core issue is access through the D$ share itself.
If you are attempting to create folders on the same physical machine, I would recommend that you simply use the machine-specific path, eg D:\folder1\folder2\etc, rather than the UNC path. Also, as an additional point (which I”m assuming is simply a typo), the UNC path provided starts with only a single slash, rather than the normal two slashes, eg \\12.34.56.789\D$…