FilamentF
Filament3y ago
Adam

Image Uploading & S3 with Previews

Currently, I am able to get my uploaded images saved on my S3 Instances, however, I've noticed a handful of issues that go against the documentation:

  • Preserving filenames do not work.
  • There is no way to preview images after they've been uploads.
  • Images do not go to the desired bucket name (when specified).
Below is my code:

FileUpload::make('featured_images')
                    ->multiple() // Allows for multiple images
                    ->acceptedFileTypes(['image/jpeg', 'image/png', 'image/webp', 'image/tiff']) // Files types we'll accept
                    ->preserveFilenames() // Ensure we keep the original file names
                    ->disk('s3') // Save to our S3 Bucket
                    ->directory('items')
                    ->columnSpan(3),


I've specified that i want to preserveFilenames() and that I want to send uploaded items to the items bucket via directory('items')

Any clarification on this would be greatly welcomed.
Was this page helpful?