Last post Jun 27, 2017 01:39 PM by march11
Jan 11, 2013 09:50 AM|Fer32|LINK
I've the following issue: in the hosting where my ASP.NET 4 application is deployed, I added a change which forced us to change the IIS mode from classic to integrated. This change produced that files cannot be wrote inside application directories (in classic
mode I haven't this issue). It is related to authentication Forms, if I remove the security of the site, this issue is fixed.
When try to execute the following code line, the Login Page is shown and the image is not saved : Me.File1.PostedFile.SaveAs(HttpContext.Current.Server.MapPath("~/Resources/lala.jpeg"))
How do I fix this issue?
Jun 27, 2017 01:39 PM|march11|LINK
You need to provide write permissions to the account that is uploading the file. There are a number of ways to do this.
The easiest is to create a dedicated AppPool for your web site, assign NetworkService user account to the AppPool with full permissions, then add the AppPool account (whatever you named it) write permissions to the upload folder.