staticcode's avatar

Upload large files

Hi guys, is there a laravel way (no other packages) to upload large files? when I do:

Storage::disk('local')->put('file.xml', $request->file);

or something like that, I always end up with and error:

Illuminate \ Http \ Exceptions \ PostTooLargeException

I set the ini file to allow files over 2gb but even when uploading a file of 24mb I get this error.

Hope someone can help me out. Using Laravel 5.5

0 likes
5 replies
Thyrosis's avatar

Which ini values did you change? I know PHP has a few different values which are related to uploading files and their sizes.

simioluwatomi's avatar

I would not put such heavy files in local for any reason... S3 solves that problem nicely. Uploading to S3 is another issue entirely though

arthurvillar's avatar

@bashy Replied to the same question a while ago, I think this is what you are looking for.

Here is the discussion

staticcode's avatar

Thanks for the links ill be sure to check them out. I set (more then this, but dont remember) these rules for sure:

post_max_size = 900M upload_max_filesize = 900M max_file_uploads = 20

did this with an ini_set command.

I read about the S3 yeah, but I rather handle it in my own code without using a external service like Amazone in this case. I mean... I should be able to upload files no matter the size e.g. 1mb or 1gb. Its my server, and I want to be able to upload files (they contain explicit data from companies, therefore it may not be uploaded at a 3rd party or through the user of a service like amazone).

staticcode's avatar

Looked at S3 but you need a creditcard and I dont have one so that aint an option. I read about the my hosting and they said I could add lines to my .htaccess file to manipulate the server. I tried that but still the same error, post size to large.

Does anyone has any alternatives I could try?

Please or to participate in this conversation.