© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
Josh777

Queue FileUpload(s) for large data (videos/images)

I have run into a situation that I have searched far and wide but can't see an answer for.

Imagine you need to upload a 100MB video to your S3 bucket via the FileUpload component. This will upload say up to 80MB to S3 before the server gateway response times out with a 504.

Instead of having this happen directly in the request, is there an obvious way we can queue uploads and job them from this component? Or chunk the uploads somehow?

I've tried doing this locally by sending the following snippet to the job, but I'm hit with serialization errors that are related to both the $file and $component.

$this->saveUploadedFileUsing(static function (BaseFileUpload $component, TemporaryUploadedFile $file): ?string {
    try {
        if (!$file->exists()) {
            return null;
        }
    } catch (UnableToCheckFileExistence $exception) {
        return null;
    }

    // dispatch rest of logic in job
    Job::dispatch($file, $component);

    // Error: Serialization of 'Closure' is not allowed
$this->saveUploadedFileUsing(static function (BaseFileUpload $component, TemporaryUploadedFile $file): ?string {
    try {
        if (!$file->exists()) {
            return null;
        }
    } catch (UnableToCheckFileExistence $exception) {
        return null;
    }

    // dispatch rest of logic in job
    Job::dispatch($file, $component);

    // Error: Serialization of 'Closure' is not allowed


Not a whizz kid with Livewire, so if anyone can help out that would be amazing. I imagine this is a problem a lot of people have run into, any answers appreciated.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

FileUpload for Cloudflare Images
FilamentFFilament / ❓┊help
2y ago
Data type for FileUpload
FilamentFFilament / ❓┊help
3y ago
How to upload large videos (+500MB) to S3 using FileUpload
FilamentFFilament / ❓┊help
3mo ago
FileUpload disable view/load for large file
FilamentFFilament / ❓┊help
3y ago