System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+

0

I am willing to save an image to a project folder in my ASP.NET CORE application after send it with base64 format from angular and converting it but the exception is throwing in the syntax image.Save(Path,ImageFormat.Jpeg);

and here is my code :

string convert = request.Avatar.Replace("data:image/jpeg;base64,", String.Empty);

byte[] bytes = Convert.FromBase64String(convert);
using (Image image = Image.FromStream(new MemoryStream(bytes)))
{
    string Path = @"Image\ddd.jpg";    
    image.Save(Path,ImageFormat.Jpeg);
}
c#
asp.net
mongodb
image
core
asked on Stack Overflow Jul 18, 2019 by Marouen Ayadi • edited Jul 18, 2019 by Markus W Mahlberg

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0