I have a form that uploads two files. If I upload small files it works well but if I upload large files gives me this warning:
Warning: POST Content-Length of 31996010 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
I have read some article that tell to change the php.in upload_max_filesize
and post_max_size
. I change both to 200M
and restart mamp.
If I go to the phpinfo file I saw both parameters with 200M, so it changes that but the warning continuous and don't upload the files.
My code to upload is that:
$coverName = uniqid($catalogue->companyId.'_C'.$catalogue->ref.'_');
$fileName = uniqid($catalogue->companyId.'_P'.$catalogue->ref.'_');
$coverExtension = $request->file('cover')->getClientOriginalExtension();
$pdfExtension = $request->file('pdf')->getClientOriginalExtension();
$destination = '/storage/app/public/uploads';
$request->file('cover')->move($destination, $coverName.".".$coverExtension);
$request->file('pdf')->move($destination, $fileName.".".$pdfExtension);
.htaccess file:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
Do I have to change some definition in laravel?
Thank you