Show Blob Image

11 views
Skip to first unread message

Luis Pesaressi

unread,
Jul 2, 2015, 1:45:27 AM7/2/15
to lar...@googlegroups.com

HI, everybody, How can show the image saved in a data base SQL Server, I have many IMG in field BLOB, somebody can say me how can do that in Laravel,

I Can show when work only PHP but whit Laravel Not work

This is in PHP this WORK

PHP

 echo "<img src=show_img.php?codstore=$cod alt='".$row['fld_webstore']."' width=".$xsize." height=".$ysize.">";


Show_img.php

<?php

ini_set ( 'mssql.textlimit' , '2000000' );

ini_set ( 'mssql.textsize' , '2000000' );

require "library_php.inc";

if(!$conn=@mssql_connect($servern,$Ulogin,$Plogin))

 {die("Cannot Connect..");}

if(!@mssql_select_db($DBserver,$conn))

 {die("Cannot Connect...");} 

$image = $_GET['codstore'];

//echo $image;

$query="select fld_logo from tabstore_logo where fld_codstore='$image'";

$rs=@mssql_query($query,$conn);

$row=@mssql_fetch_row($rs);

$imagebytes=$row[0];

if(is_null($imagebytes))

 {$query="select fld_logo from tabstore_logo where fld_codstore='NZTB'";

  $rs=@mssql_query($query,$conn);

  $row=@mssql_fetch_row($rs);

  $imagebytes=$row[0];} 

header("Content-type: image/jpeg");

echo $imagebytes;

header("Content-type: text/plain");

?>

somebody can help me...for change in  Laravel

Thanks Luis

Reply all
Reply to author
Forward
0 new messages