© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
2 replies
delboy1978uk

file upload mutate on upload

When I mutate the data, i only get the generated filename, but i need the original uploaded file name for display purposes, is there a way to do this?
Solution
 ->afterStateUpdated(function (TemporaryUploadedFile $state, callable $set) {
    if ($state) {
        $name = $state->getClientOriginalName();
        $ext = $state->getExtension();
        $set('filename_uploaded', $name . '.' . $ext);
    }
})
 ->afterStateUpdated(function (TemporaryUploadedFile $state, callable $set) {
    if ($state) {
        $name = $state->getClientOriginalName();
        $ext = $state->getExtension();
        $set('filename_uploaded', $name . '.' . $ext);
    }
})
Jump to solution
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

Upload file stuck at uploading status on coolify
FilamentFFilament / ❓┊help
13mo ago
upload file
FilamentFFilament / ❓┊help
2y ago
File Upload
FilamentFFilament / ❓┊help
2y ago
File Upload
FilamentFFilament / ❓┊help
3y ago