This my API..
- [HttpGet]
- public IActionResult Get()
- {
- Byte[] b = System.IO.File.ReadAllBytes(@"E:\\Test.jpg");
- // You can use your own method over here.
- return File(b, "image/jpeg");
- }
i m getting responce as File,, I am reading this responce as
var responce = request.Content.ReadAsByteArrayAsync().Result;
i want ot create Object url for this in mvc controller and wanted to set objUrl to src of image tag in View

Laxmidhar SahooPosted Mar 2, 2020, 11:18 PM
public IActionResult Get()
{
Byte[] b = System.IO.File.ReadAllBytes(@"E:\\Test.jpg");
// You can convert to string using method Convert.ToBase64String from byte array.
string result = Convert.ToBase64String(b,0,b.length);
//return File(b, "image/jpeg");
return result;
}
https://jsfiddle.net/yasumodev/tg298ns7/
Dileep SinghPosted Mar 2, 2020, 9:23 PM
Joginder BangerPosted Mar 1, 2020, 11:24 PM
Viswanatha SwamyPosted Mar 1, 2020, 10:48 PM