User1742304165 posted
I am not sure if this is causing it but you can't use the ~/ when working with the filesystem
string fullPath = ConfigurationManager.AppSettings["SaveNewsImages"];
string tempPath = ConfigurationManager.AppSettings["TempImages"];
Random rd = new Random();
string s = rd.Next().ToString();
strFilePath = fullPath;
strFilePath += s + ".jpg";
string strTempPath = tempPath + s + ".jpg";
fileUpload.PostedFile.SaveAs(Server.MapPath(strTempPath));
System.Drawing.Image fullSizeImg = System.Drawing.Image.FromFile(Server.MapPath(strTempPath));
//Not sure if you have a function Called ResizeImage but i think it is ResizeImageFile(byte[] length, Size), this is probably where your issue is coming from.
System.Drawing.Image shortImg =
ResizeImage(fullSizeImg,75);
//no need to to set reaPath p= to strFilePage since i is already in full context. your just setting a string to another string without changing anything
shortImg.Save(Server.MapPath(fullPath));
return s + ".jpg";
Hope this helps (question, are you using the fileupload control o just an input type=file html element
Joshua