© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
32 replies
Matthew

FileUpload file saved with encrypted name, preview with original name

Maybe im missing something in the docs, but so far I havent found a way to upload a file, and save it with a hashed name, but when you preview its with the original name.
                FileUpload::make("attachment")
                    ->disk("public")
                    ->visibility("public")
                    // ->collection('attachments')
                    ->multiple()
                    ->enableReordering()
                    // ->saveUploadedFiles()
                    // ->preserveFilenames()
                     ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string {
                         return (string) str($file->getClientOriginalName())->prepend('custom-prefix-');
                     }),
                FileUpload::make("attachment")
                    ->disk("public")
                    ->visibility("public")
                    // ->collection('attachments')
                    ->multiple()
                    ->enableReordering()
                    // ->saveUploadedFiles()
                    // ->preserveFilenames()
                     ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string {
                         return (string) str($file->getClientOriginalName())->prepend('custom-prefix-');
                     }),

Am I missing something?
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 doesnt save original name in attachment_file_names
FilamentFFilament / ❓┊help
14mo ago
How to download a file from FileUpload with original name
FilamentFFilament / ❓┊help
13mo ago
FileUpload with PDF preview.
FilamentFFilament / ❓┊help
2y ago
Show preview of already saved image in FileUpload
FilamentFFilament / ❓┊help
5mo ago