2

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

SWeko
  • 30,434
  • 10
  • 71
  • 106
e-on
  • 1,547
  • 8
  • 32
  • 65
  • 1
    Have you confirmed that the process has access _down_ to the `\upload` folder? ie is it possible that there's restrictive permissions set higher up the tree that's blocking access? – Sepster Sep 29 '12 at 13:06
  • Shame you deleted that answer Bryan. Had some good information in it... – e-on Sep 30 '12 at 13:06

1 Answers1

1

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$...

SWeko
  • 30,434
  • 10
  • 71
  • 106
David W
  • 10,062
  • 34
  • 60
  • The two slashes were eaten by the MarkDown, both in the OP and in your answer. – SWeko Sep 29 '12 at 20:09
  • Figured it was likely a typo, but just in case... :) Really think the solution is to get away from accessing folders through admin share. Good luck. – David W Sep 29 '12 at 20:11
  • Hi David, thanks for this. I changed it to a full path (d:/inetpub... etc) and it worked straight away. Annoyed at myself for not trying that earlier! Great to know that about permissions though - wasn't aware of that. – e-on Sep 30 '12 at 12:35
  • Great! Glad I was able to help. – David W Sep 30 '12 at 15:18