Send a fileupload to an image type field to SQL Server in Laravel PHP

Viewed 118

My question is how to send a file to a field of type image from Laravel to SQL Server?

$image  = file_get_contents($file);
$sql    = "INSERT INTO tabla ( CONTENIDO  ) VALUES (?);";
$params = array(array($image, SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STREAM(SQLSRV_ENC_BINARY)));

This way I can only insert varbinary and what I need to be inserted into image type.

0 Answers
Related