I want to do convert image in byte array and pass it to web api to save image on server and image name in database.
I have done following code but getting exception as Parameter is not valid when I am using this block -
byte[] param contains byte array value of image from request url
using (var ms = new System.IO.MemoryStream(param))
{
var cd= Image.FromStream(ms);
//...
}
using (var ms = new System.IO.MemoryStream(param))
{
var Image= Image.FromStream(ms);
//...
}
I have tried the solutions as I have found in searching but same error occured.
Can anyone help me to resolve this error.