HawkEnc's avatar

Large video file upload error.

Hey Guys. Hello! I'm new to Laravel and I have some issues. I am using Php Laravel. I am making a Flutter application using Php Laravel and made backend using the same. Right now I'm facing issues while uploading videos. Like I am able to upload videos up to 200-300mb but when I try to upload 700mb + videos it shows this red progress bar. I am waiting for more then 30mins+ still the video has not uploaded. I am not sure what code do I need to change or what I need to do exactly. I have changed the Php.ini settings like max upload size and everything to unrestricted like -1 or 0 still I am facing this issue. I tried implementing chunk uploads and I don't think the chunk upload code is working. So what can I do please help me.

0 likes
5 replies
Tray2's avatar

The request timeout is usually 60 seconds, and if that is not enough, I would suggest using a package that chunks the uploads.

Resumable js seems to be quite popular.

1 like
HawkEnc's avatar

@Tray2 Hey there, I will try this today itself.

Thank you :)

aarontharker's avatar

There are a number of things you will need to check regarding this.

The first and certainly most common is php.ini settings. Both 'post_max_size' and 'upload_max_size' are directly responsible for causing issues like the one you are facing, but there are also several more obscure ones, like 'memory_limit', 'default_socket_timeout', 'max_input_time', and 'max_execution_time'.

The next thing is upload validation. Have you set a rule limiting file size? Are you using Livewire (which has limits set on its 'temporary_file_upload' size in the 'config/livewire.php'

The final thing is, are you using Cloudflare or something similar that is imposing limits on your upload? Cloudflare, for example, has a 100Mb max_post_size and a 60-second timeout imposed on free connections.

1 like
HawkEnc's avatar

@aarontharker Hey there, I'm using Laravel Encore and Cloudflare tunnel for simulation of live endpoint (cloudflared tunnel --url). As of this I tried yesterday it took 1hr plus to upload a 700mb to my local server. I have changed the php.ini file to keep everything unrestricted so I can upload any size. And in my code I have not set any rules that limits anything. If there are any additional feedbacks please do let me know.

Thank you. :)

martinbean's avatar

@hawkenc You’d be better off doing chunked uploads to somewhere like S3 where the file can be uploaded in parts, rather than trying to upload it via a Laravel endpoint that’s either going to time out or exceed memory limits.

1 like

Please or to participate in this conversation.