I've narrowed down the issue I'm having to this block of code, where I am resizing an uploaded image and saving it. This works fine on my local machine, but when I run the site on the server, I get a generic GDI+ error that's coming from the "thumbnail.Save" call.
if(fup_displayPicUpload.HasFile)
{
string imageDir = Server.MapPath("./images/");
if (!Directory.Exists(imageDir + username))
{
Directory.CreateDirectory(imageDir + username);
lbl_profileMessage.ForeColor = Color.Yellow;
lbl_profileMessage.Text = "Created User Folder";
}
String userFolder = imageDir + username + "/";
using (System.Drawing.Image originalPhoto = new Bitmap(new MemoryStream(fup_displayPicUpload.FileBytes)))
{
System.Drawing.Image thumbnail = originalPhoto.GetThumbnailImage(300, 300, Abort, IntPtr.Zero);
thumbnail.Save(userFolder + "displaypicture.jpg", ImageFormat.Jpeg);
}
displayPictureUrl = "/images/" + username + "/displaypicture.jpg";
}