1

I have one database table where images are stored as strings. I'm trying to get this field content and add it to ftp server as image.

$data = $tbExpenseFile->full_image;
$hash = Str::random(16);
\File::makeDirectory(storage_path().'/storage/'.$hash);
$tbFile = storage_path().'/storage/'.$hash.'/'.$tbExpenseFile->full_image_name;
\File::put($tbFile, $data);

It's working, but bigger images are not uploaded fully, 1/4 from image is visible and remaining part is gray. In ftp these image sizes are 1048576 == 1mb.

I'm trying to figure out what can be the limit, maybe database string read limit, because laravel put method uses file_put_contents, so i think the problem is not there.

Einārs Ozols
  • 155
  • 1
  • 10
  • See http://stackoverflow.com/questions/5775571/what-is-the-maximum-length-of-data-i-can-put-in-a-blob-column-in-mysql – Mysteryos Oct 26 '15 at 12:02

1 Answers1

0

I found problem, need to deal with PDO settings in database config:

'options' => array(PDO::MYSQL_ATTR_MAX_BUFFER_SIZE => 16777216)
Einārs Ozols
  • 155
  • 1
  • 10