Where are Images Stored

What table are images stored in?

I want to get the file path or the binary file to display on an internal webpage.

I see they are on [Erp].Image but that doesn’t have a path or a binary blob of the file.

The Blob is stored in “FileStore” table. You have to custom code the conversion back to an image but that’s where the Blob is.

Would anyone happen to know how Ice.FileStore is joined to Erp.Image?

I think I figured it out.
Here is the SQL:

    SELECT p.PartNum, p.ImageFileName, p.ImageID, 
    	   i.*,
    	   fs.*       	   

    FROM [dbo].Part AS p

    INNER JOIN [erp].[Image] AS i
    ON (p.Company = i.Company AND 
        p.ImageID = i.ImageID)

    LEFT JOIN [Ice].[FileStore] AS fs
    ON (fs.Company = i.Company AND      
    	 fs.SysRowID = i.ImageSysRowID )

    WHERE p.PartNum = '56-044128-000'

You got it that’s the link. Thumbnail SysRow does the same thing hits a different record in FileStore

1 Like

Just in case anyone is wondering how you can change the BLOB into an image for output on a webpage you can do something like below.

This is PHP Code:

$row = sqlsrv_fetch_array($row);
echo "<img src='data:image/jpeg;base64," . base64_encode( $row['Content'] ) . "' alt='" . $row['ImageFileName'] . "' />";
2 Likes