How to get a image from what the user submitted to a frame in c#?

51 Views Asked by At

So at the moment I have this and It does not work because you cant grab local files for security reasons. But what im trying todo is the user submits these pictures inside a Excel and I grab these pictures and put them into a string builder to preview. So if there is a way todo this please let me know.

    StringBuilder sb = new StringBuilder();
    Spire.Xls.Workbook workbook = new Spire.Xls.Workbook();
    workbook.LoadFromFile(Path.Combine(path, file));
    Spire.Xls.Worksheet sheet = workbook.Worksheets[0];
    Spire.Xls.Collections.PicturesCollection pictures = sheet.Pictures;
    for (i = 0; i < pictures.Count; i++)
    {
        string image_Path = Path.Combine(path, "image"+i));
        pictures[i].Picture.Save(image_Path, System.Drawing.Imaging.ImageFormat.Png);
         sb.Append(@"<img src=" + image_Path + "/>");   
 }
0

There are 0 best solutions below