c# - Access to the path is denied while using FileUploadControl -


I am trying to save an uploaded file:

  string SaveLocation = Server.MapPath (@ "~ \ data"); FileUploadControl.SaveAs (SaveLocation);  

I've given the full control permission for the following code to save both solutions and targets:

  • Network Service
  • IIS_IUSRS
  • ASP.NET / Markin
  • IUSR

I received the & lt; Identity impersonate is determined = "False" /> in web.config .

I tried all of the above methods but still are not able to reach the path:

Error: Path is denied

I know what I have to do to reach the path.

requires a full filename, not only the directory you passed.

  string SaveLocation = Server.MapPath (@ "~ \ data \ somefile.png"); FileUploadControl.SaveAs (SaveLocation);  

Every time you upload a file, make sure to change the file path, or the file will be overwritten.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -