I haven't heard of a limit, I would think it would tie to the php memory limit.
I did look around in the code trying to see if I could see a limit set somewhere but I didn't find anything.
I made up some test code for this as follows:
I created a dummy random text file with a byte size of 2039808 right at 2 meg. And dumped that in to my test Mysql db table.
In my app\config\database.php the PDO Fetch Style is the default, 'fetch' => PDO::FETCH_CLASS
Made a simple test table,
CREATE TABLE `testtable` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`testvalue` LONGTEXT NULL,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB;
Made a simple test route,
Route::get('/', function()
{
$r = Testmodel::where('id', '=', 2)->get()->toArray();;
var_dump(strlen($r[0]['testvalue']));
return 'test project loaded';
});
The output is
int 2039808
test project loaded
The str length matched my input size.
I also tried with a 8 meg data size, it also returned all the data.
Not sure what else to try.
Thanks for your test. I forgot to mention: I'm running it from the command line using artisan, gonna try it as you did now.
If I find what's causing this, I'll let you know, so far I'm kinda clueless though.
Hi Kryticals, I am having this exact same issue with the same amount of bytes: 1048576. Did you ever figure out what this was? I am wracking my brain trying to figure this one out. Interesting thing is that it works locally, and not on productions, so I am not sure it is specifically a Laravel issue, but maybe just server config.
Thanks!
Hello there, I'm also having the exact same problem. I'm storing profile picture in my database as a Blob. Everything works fine: when i'm saving the blob from phpmyadmin, I get the full picture.
But it does not work using laravel : when i'm getting the blob content via the $request->user()->picture for example, i'm not getting the entire image. I saved it to the disk to be sure (via file_put_contents) and the file is then exactly 1024KB.
Note that I also tried with a regular PDO connection and everything worked fine.
Did you guys figure it out ?
Thanks !
Well, apparently googling "laravel 1MB limit" is better than "1024Kb limit" :p
The issue comes in fact from PDO, but the one initialized by eloquent. added 'options' => array(PDO::MYSQL_ATTR_MAX_BUFFER_SIZE => 16777216) for the mysql connector in database.php conf file and everything is fine now :)
aszlaga liked this reply
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community