Support the ongoing development of Laravel.io →
Requests Input Forms

I'm working with a form that uploads files and stores them in S3, using code such as the following:

$file = $request->file('photo'); 
$s3 = Storage::disk('s3');
$s3->put($key, file_get_contents($file));

If a file upload is a slightly larger size (seems to be around 2MB+) I get a completely empty response from the server (Chrome shows "No data received, ERR_EMPTY_RESPONSE, Unable to load the webpage because the server sent no data.)

I have no idea what may be causing this. There are no errors thrown, no errors in the PHP errors logs, and no response at all from the server. I can place a die() statement before the $s->put() and it will reach that. If I place it after, I get no response from the server. This is only for files 2MB+ in size, smaller files work fine with no issues.

Any thoughts, ideas, or other things to try?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

rcrisp rcrisp Joined 1 Mar 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.