title: Save file to a folder in the website in medium trust in ASP.NET
body: <p>In my website I save images to a folder(Photos) in code-behind by calling</p>
  
  <p><code>ImageUploadControl.PostedFile.SaveAs(HttpContext.Current.Server.MapPath("~/Photos/" + Name + ext));</code></p>
  
  <p>which throws an error <code>'Access not allowed'</code> in medium trust.
  Any alternate to save images in medium trust? The folder needs to be publicly accessible as clients access these images without any authentication, so I cannot save it in App_Data(one fix to this problem)</p>
  
  <p>*Website is hosted on hostgator shared plan. There is a limitation to how much I can ask for server configurations.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Yes its a access issue, as resolving the ~ tilda, virtual paths is not allowed. I hope anyone has a workaround for this problem.</p>