title: Subdomain Hosting Issue with Disk Access (C#/ASP.NET 3.5)
body: <p>This isn't a very complicated scenario really, but as I start to type out the problem I'm realizing how convoluted it can become textually.  Let me try and be very clear:</p>
  
  <p><strong>First, the set up...</strong></p>
  
  <p>I have a C#/ASP.NET web application that is publicly facing on my main domain (www), let's call it <strong>www.mysite.com</strong>.  Nothing fancy, just a front-end that connects to SQL to display records.</p>
  
  <p>Then, I have a second C#/ASP.NET web application that is secured using forms authentication running on a subdomain, let's call it <strong>admin.mysite.com</strong>.  This is a very light-weight CMS system to administer the public site.</p>
  
  <p><strong>Now, the problem...</strong></p>
  
  <p>Both of these sites run fine for basic tasks, however, my problem arises when I try to gain access to the file system for uploading. My webhost requires subdomains to run as a virtual directories under the main application in IIS (so the subdomains actually resolve/re-direct to www.mysite.com/admin when you type in admin.mysite.com), but because of this I am unable to write to my website root from the subfolder.</p>
  
  <p>Let me explain a little more...</p>
  
  <p>The CMS system (running as a virtual directory) gives the admin the ability to upload photos for display on the main site, the target folder of which is www.mysite.com/images - when attempting disk access from the root app, I am able to write to the virtual directory, but cannot do the opposite -- that is, write to the root from the virtual directory, getting security violations.  If I can only upload to the /admin/ virtual directory, the entire point is moot because it's a secured folder that the public can't see!</p>
  
  <p>The only solution I can think of is to upload the files to the /admin/ virtual directory, then call a URL in the root that moves files from /admin/ back to the root, but that is entirely ghetto.</p>
  
  <p>I hope this post makes sense.  Anyone else experience anything like this?  The bottom line is that it seems virtual directories ONLY have access to themselves, and not their parent directories, no matter what credentials are used.</p>
  
  <p>Thanks!</p>