Answer the question
In order to leave comments, you need to log in
How to extract an image from MS SQL database?
Hello uv. community. Tell me, please, I am deriving a field with the image type from the MS SQL database, where the image is stored in binary format (0хFFD8FFE000104A46494600010100000100010000F...). When requested, only a part of the picture (4 kb) is displayed. What could be the problem?
Here is the code:
$con = mssql_connect($server, $user, $pass) or die("Couldn't connect to MSSQL Server on $server");
$result = mssql_query("SELECT TOP (1) Data FROM nameTable WHERE id='2310'");
$item = mssql_fetch_assoc($result);
echo '<img alt="" src="data:image/jpg;base64,'.base64_encode($item['Data']).'">';
Answer the question
In order to leave comments, you need to log in
See https://dev.1c-bitrix.ru/api_help/main/general/url...
But it's better not to do this, I advise you to do one nesting level, for example: /brands/panasonic/
no extra folders
I solved the problem, the whole thing was in mssql.textlimit = 4096.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question