isco's avatar
Level 1

Symfony\Component\ErrorHandler\Error\FatalError: Allowed memory size of 134217728 bytes exhausted (tried to allocate 161728520 bytes) in file /var/www/html/talksvs-laravel-api/vendor/league/flysystem/src/Util/MimeType.php on line 28

Can someone give me a hand with this issue please? What could be a real solution for this? I'am trying to upload videos to an VPS server. This is a short from my code:

    //Get uploaded file
    $file = $request->file('file_contents');

    //Path to save file
    $savePath = "clients/{$request->get('client')}";

    //Store file in local
    Storage::disk('local')->put("$savePath/uploads/{$file->getClientOriginalName()}",file_get_contents($file->getRealPath()));
0 likes
5 replies
isco's avatar
Level 1

@frankielee first, thanks for your help! Then yes, I have uploaded smaller videos too and these have been uploaded succesfully. I'll try these settings and let you know how was it goes...

Snapey's avatar

file_get_contents will load the entire file into memory before writing any of it anywhere

instead you need to stream the file to the new location

Please or to participate in this conversation.