Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Mikegk's avatar

Livewire: Upload big files

Hi guys,

how can I upload huge files with livewire? I already upgraded valet / nginx and everything - but livewire seems to reject bigger files

{
    "files.0": [
        "The files.0 may not be greater than 12288 kilobytes."
    ]
}

I don't know where to fix that.

0 likes
8 replies
neilstee's avatar
neilstee
Best Answer
Level 34

@mikegk by default, Livewire will validate ALL temporary file uploads with the following rules: file|max:12288

If you wish to customize this, you can configure exactly what validate rules should run on all temporary file uploads inside config/livewire.php:

return [
    ...
    'temporary_file_upload' => [
        ...
        'rules' => 'file|mimes:png,jpg,pdf|max:102400', // (100MB max, and only pngs, jpegs, and pdfs.)
        ...
    ],
];

Source: https://laravel-livewire.com/docs/2.x/file-uploads#configuration

4 likes
neilstee's avatar

@mikegk don't forget to mark it as "Best Answer" if it solves your problem so others can find it useful as well 😉

1 like
Mash Square's avatar

unfortunately this does not help much for bigger files (like 1Gb or more).

You can change the livewire settings and it will allow you to eventually upload files which are 100-130 mb circa without a problem but if you are looking to upload your content on S3 you need multipart upload and apparently this is really difficult to setup: you could use "fopen" but this requires you to know in advance the location of files which will need to be stream-uploaded to the cloud...and that's never the case if you want users to upload content....

1 like

Please or to participate in this conversation.