0

Problem:
Image cannot be loaded. Chrome-Error message: net:: ERR_INVALID_URL

MSSQL:
I created a table with two columns (ID and Image as varbinary(MAX)) and filled it with data using an insert query. The image-links are tested. enter image description here

The Query looks like that:

INSERT INTO ST_CCG.main.Images(Image)
    SELECT BulkColumn
    FROM Openrowset (Bulk 'I:\1001.png', Single_Blob) as Image
...

C#:
Here is how I'm retrieving the data using an byte array to save the binary.

using (SqlDataReader reader = command.ExecuteReader(System.Data.CommandBehavior.SequentialAccess))
{
    while (reader.Read())
    {
        result.Add(new BusinessObjects.Image
        {
            ID = (ushort)reader.GetInt16(0),
            Image_Binary = (byte[])reader["Image"]
        });
    }
}

Created a WCF-Service with WebGet and WebMessageFormat.Json as ResponseFormat.

AngularJS:
Loading the data with restangular successfully (Status: 200).
Then I'm trying to show one of the pictures in my view like that:

<img ng-src="{{'data:image/PNG; base64,' +customizing.images[0].Image_Binary}}">

Then I get the error above. What am I doing wrong?

enter image description here

cramopy
  • 3,459
  • 6
  • 28
  • 42
AJ_83
  • 289
  • 1
  • 8
  • 22

0 Answers0