ASP.NET error on resize
When I use the Smart Image Processor, I get the following error:
Error: System.UnauthorizedAccessException: Access to the path "C:\Inetpub\Wwwroot\xxxx\images\xxx.jpg" is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.File.Delete(String path) at _ASP.resizeImage_aspx.Page_Load(Object s, EventArgs e)
Error: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+. at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams) at _ASP.ResizeImage_aspx.Page_Load(Object s, EventArgs e)
The folder where the images get uploaded and resized, need to have full permissions for a few special accounts. Just right click on it and select "sharing & security". Choose the "Security" tab and select the following user : "aspnet_wp account (Computer name\ASPNET)" (IIS_WPG in Windows 2003) and give this user read/write rights on the folder. If this user is not in the list, press Add -> Advanced -> Search Now and select the user in this list. Press OK and the user will be selectable for you to change his rights on your download folder.
NOTE: Make sure the also the IUSR_xxx and IWAM_xxx (if on domain controller) user accounts also have full permissions to this folder.
See also this FAQ