Hi
I am trying to convert images to base64 as part of data we deliver from one of our solutions, but I get an access denied error
System.UnauthorizedAccessException: Access to the path 'E:\Dynamicweb.net\Application(9.10.7)' is denied.
Is it not possible to convert image to base64 on a dynamicweb solution?
My code is like this.
@using System.Web;
@using System.IO;
@using System.Drawing;
@foreach(LoopItem i in GetLoop("ItemPublisher:Items.List")){
string tempimg=@i.GetString("ItemPublisher:Item.Image");
string DefaultImagePath = HttpContext.Current.Server.MapPath(@tempimg);
byte[] imageArray = System.IO.File.ReadAllBytes(DefaultImagePath);
string base64ImageRepresentation = Convert.ToBase64String(imageArray);
}
/Hans