© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
Jon Mason

How do I access the uploaded file?

I have 2 nearly identical forms on livewire components. In one of them, the file upload works fine and I get the TemporaryUploadedFile when I do
$this->form->getState()
$this->form->getState()
. On the other one, I just get null.

public function form(Form $form): Form
    {
        return $form->schema([
           
         
            FileUpload::make('document')
                ->label('Upload Document')
                ->preserveFilenames()
                ->acceptedFileTypes(['application/pdf'])
                ->maxSize(12288)
                ->storeFiles(false)
            //->hidden(fn () => $this->statement?->document_id !== null)
        ])->statePath('data');
    }
public function form(Form $form): Form
    {
        return $form->schema([
           
         
            FileUpload::make('document')
                ->label('Upload Document')
                ->preserveFilenames()
                ->acceptedFileTypes(['application/pdf'])
                ->maxSize(12288)
                ->storeFiles(false)
            //->hidden(fn () => $this->statement?->document_id !== null)
        ])->statePath('data');
    }


I have this in my render method:

$this->form->fill($this->statement->attributesToArray());
$this->form->fill($this->statement->attributesToArray());

and doing this in my save method:

    public function save(): void
    {
        dd($this->form->getState());
}
    public function save(): void
    {
        dd($this->form->getState());
}


document is just null. I feel like this was previously working, so I don't know what changed.
image.png
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

Access the Temporary uploaded file in form action
FilamentFFilament / ❓┊help
3y ago
How to access an uploaded file without a resource
FilamentFFilament / ❓┊help
2y ago
How do I access the meta information of uploaded files in the afterCreate hook?
FilamentFFilament / ❓┊help
3y ago
How can I get the uploaded file before saving data
FilamentFFilament / ❓┊help
3y ago