Mega Anaska

Mega Anaska

  • 1.8k
  • 120
  • 11k

Convert url to base 64

Jul 15 2019 9:14 PM
Hallo I want covert http://malubov.blogspot.com/18090005.jpg to base 64. is it possible ? I tried to use this script but error 
 
Uri uri = new Uri("http://malubov.blogspot.com/18090005.jpg");
//string path = HttpContext.Current.Server.MapPath(uri.AbsolutePath);
//string base64String = null;
//using (System.Drawing.Image image = System.Drawing.Image.FromFile(path))
//{
// using (MemoryStream m = new MemoryStream())
// {
// image.Save(m, image.RawFormat);
// byte[] imageBytes = m.ToArray();
// base64String = Convert.ToBase64String(imageBytes);
// }
//}
 
 

Answers (2)