F
Filament7mo ago
Mike

upload to s3 with thumbnails driving me nuts on filament side

So i need to upload a image to s3, all good, but i also need to upload the same image but thumbnail size. I got this working but the issue is that if i dont specify s3 disk i dont get file previews but also im unable to copy the file for thumbnail generation as its a temporary livewire file. I tried events, handle before create etc, driving me nuts. How can i override the s3 upload process while being able to copy the file Any help is appressiated
Solution:
@awcodes resolved thank you. i followed the default code of saveUploadedFileUsing
Jump to solution
4 Replies
awcodes
awcodes7mo ago
Should just be a matter of creating the thumbnail then Storage::disk(‘s3’)->put($filedata, $filename) Data and name might be reversed. Don’t remember off the top of my head.
Mike
MikeOP7mo ago
@awcodes But how do i hook into the upload process, if i specify the disk as s3 im unable to create the thumbnail as it appears the file upload is still in the temporary directory and events fail
awcodes
awcodes7mo ago
It’s not your specific use case. But have a look at the Curator plugin to see how I’m overriding the FileUpload’s save function to process the temp file. Might be some insight there you can use. Look at the Uploader class.
Solution
Mike
Mike7mo ago
@awcodes resolved thank you. i followed the default code of saveUploadedFileUsing
Want results from more Discord servers?
Add your server