© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
74 replies
rabol

How come filename include the directory

Hi

why does the file name of a file upload include the directory name ?


I have this in my form

Forms\Components\FileUpload::make('filename')
                    ->required()
                    ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string {
                        return Str::orderedUuid() . '.docx';
                    })->disk('public')
                ->directory('templates'),
Forms\Components\FileUpload::make('filename')
                    ->required()
                    ->getUploadedFileNameForStorageUsing(function (TemporaryUploadedFile $file): string {
                        return Str::orderedUuid() . '.docx';
                    })->disk('public')
                ->directory('templates'),


after file upload the filename is something like this.

templates/993ea9ce-598f-4f6c-ae04-645f3321c7b5.docx
templates/993ea9ce-598f-4f6c-ae04-645f3321c7b5.docx
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

Just get the original filename?
FilamentFFilament / ❓┊help
6mo ago
How come state breaks infolist
FilamentFFilament / ❓┊help
2y ago
How to dynamically change the FileUpload directory field ?
FilamentFFilament / ❓┊help
3y ago
Next page