#preserveFilenames() not working with SpatieMediaLibraryFileUpload
11 messages · Page 1 of 1 (latest)
Try placing it at the end of the field definition
No luck, it was already at the end.
Not sure whether that method works on with SpatieFileUpload since Spatie handles the upload and storage and not Filament
I might be wrong, but I don't think the Spatie Media Library is renaming files by default. It seems like it is the standard filament behaviour and preserveFilenames() is just not working.
Question.. is this is the download or the storage?
I am using this perfectly well:
SpatieMediaLibraryFileUpload::make('document')
->hiddenLabel()
->disk('s3_data')
->collection('documents')
->downloadable()
->openable()
->visibility('private')
->acceptedFileTypes(['application/vnd.openxmlformats-officedocument.wordprocessingml.document'])
->preserveFilenames(),
I was referring to the filename in storage, I'm not using ->downloadable(). So with this config, the files won't be renamed on the storage in your environment?
Where are you storing it? That stores correctly in storage for me.
I tested different disks, but the result is always the same. I also tried using the documented method for custom names and then just returning the original name in it, but this also doesn't change anything: ->getUploadedFileNameForStorageUsing( fn(TemporaryUploadedFile $file): string => (string) str($file->getClientOriginalName()), )