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);
}
User contributions licensed under CC BY-SA 3.0