laravel-mediable icon indicating copy to clipboard operation
laravel-mediable copied to clipboard

Manipulating uploaded file?

Open LaravelFreelancerNL opened this issue 3 years ago • 2 comments

Hi,

I'd like to manipulate an uploaded file right away. For example: changing the file format from jpg to webp.

From what I gather you need to first store the uploaded file, then create a variant and promote it to original status and then remove the old file.

I'm looking to do that in one step right off the bat. Is that possible?

LaravelFreelancerNL avatar Jan 21 '22 12:01 LaravelFreelancerNL

Yes, it is currently designed to be multi step. Since manipulation can be a little heavier, it is recommended to do it async, which means you have to put the file somewhere. That said, it certainly could be done synchronously in the upload process. PRs are always welcome 🙂

frasmage avatar Jan 22 '22 13:01 frasmage

Cool, I'll go with the multi-step and see if I really need it in one step later on. If so you'll get that PR. :)

LaravelFreelancerNL avatar Jan 22 '22 15:01 LaravelFreelancerNL

Implemented in upcoming major version #343

frasmage avatar Apr 01 '24 20:04 frasmage

Version 6.0.0 has been released.

frasmage avatar Apr 07 '24 02:04 frasmage