Resize image in SpatieMediaLibraryFileUpload
Hello, I find Spatie's package excellent, especially for defining conversions to resize uploaded images. However, I'm wondering if there's a way to convert the original file before it gets placed on the server, thus skipping the conversions. The issue is that the original file remains publicly accessible, and I'd like to prevent that.
Regards,
Darius
7 Replies
have you checked media library docs?
I did, did I overlook anything?
As mentioned, the conversions are clearly specified in the docs. But these create a subfolder called conversions with the originally uploaded image file in the root. I would not want the root image to be created, but rather only the conversions.
doesn't seem that's posible
I was hoping for some sort of a beforeSave method or perhaps via an observer
Does FileUpload allow this?
if manually then you could delete file
Not optimal, but you can a write model trait that cleans the root files on save.
observer in the model one way