I am getting an error (A generic error occurred in GDI+.) when I try to replace images from a folder .It works fine when it runs in localhost.
Here is my Code :
if (FuBannerImg2.HasFile)
{
int width = 1920;
int height = 1280;
Stream stream = FuBannerImg2.PostedFile.InputStream;
Bitmap image = new Bitmap(stream);
Bitmap target = new Bitmap(width, height);
Graphics graphic = Graphics.FromImage(target);
graphic.DrawImage(image, 0, 0, width, height);
target.Save(Server.MapPath("~/img/bg-img/bgimg1.jpg"));
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "clientScript", "alert('Image uploaded Successfully')", true);
fillhome();
;