#File Upload Max Size

43 messages · Page 1 of 1 (latest)

slender tide
#

Hi Everybody.
I tried upload 8M video file using Laravel File Upload.
But this error comes.
Does anyone can guide me through this simple error?

elder crest
#

It means the file is larger than the server could handle

slender tide
#

Already configured php.ini

#

Thank you @elder crest

#

How can handle then?

elder crest
#

Is this local or in production

slender tide
#

production

#

cpanel

elder crest
#

cPanel usually means shared hosting, which means you might not have the ability to change the settings required to fix this

slender tide
#

Hmm

elder crest
#

You can configure max size sent over the webserver, which in the case of shared hosting means Apache

slender tide
#

Please guide me, I have already looked php.ini

elder crest
#

I am not familiar with Apache so I don't know how to do that, in NGINX it's just a directive to say the max size

slender tide
#

I know NGINX

#

current php.ini

elder crest
#

yes, but that's PHP

#

You can halt file size on the webserver, which looks like is the case on that error on the image

#

Which means you need to configure Apache to allow filesizes >8M

slender tide
#

Yeah, I know.

#

but still not find solution, so I posted here. 😏

elder crest
#

But again, not sure you have permission to edit this stuff on shared hosting. Haven't used it in ages, and certainly haven't used Apache for years.

slender tide
#

Thank you. Will keep try. @elder crest

elder crest
azure whale
#

if it's a cpanel is there a software section and in there a select php version in your panel?

proven rivet
#

@slender tide You can’t upload files multiple megabytes in size in one to like this. You’re either going to hit a timeout or exceed available memory. You should instead be doing chunked uploading, where you send the file in multiple smaller parts.

safe gale
#

Though at some point, using a proper storage bucket may be in your best interest.

silk jewel
#

I had never heard of this feature, didn't know you could chunk on the front end. This solves a lot of problems

sick tundra
#

ok I am here, there are 2 places you have to change. you got the one, upload_max_filesize, but there is another one as well. post_max_size - make sure both are set to what you require.

sick tundra
#

The other thing is, depending on how you are doing it, will define what php.ini you are accessing. For example, if you are using some random CLI that bypasses the webserver, you need to change the cli php.ini

#

the EASIEST way to find out if you are actually making the right changes is to create a dummy php file. so in the root of your webserver, create a file called info.php

<?php
phpinfo();
?>
#

then open that file up and check what your results are

#

if they look correct there, then you want to check your cli, then type at a comamnd php -i

silk jewel
#

Keep in mind that because you're on shared hosting, you won't be able to exceed the values that the server admin put in place (or maybe not change them at all if they are strict).

sick tundra
#

Correct, which is why I suggest creating the php info file. You will find out if you are even making changes that are being taken into effect

#

side note: this is why I don't use shared hosting anymore and find forge with a DO droplet or just a $5 droplet is easier

safe gale
# silk jewel I had never heard of this feature, didn't know you could chunk on the front end....

Works wonders. I needed to be able to ingest large 3d assets directly since our internal systems need direct file access, thus S3 was not viable for us, as I would need to download files every single time the internal stuff needed to act on it. So I use the above package, but purely for their basic request handler, as we wrote a basic but functional slicer in our React frontend that does the job. Just need to add headers for the current chunk and total chunks. Keep in mind that the final uploaded chunk will trigger it to be assembled, thus will usually take the longest.

elder crest
sick tundra
elder crest