I want to run some custom transforms on a file before it's uploaded.
Looking at the arguments received in the beforeChange hook, I don't think it's possible to handle it there. Is there a way to do this?
Just a thought: maybe it might work with some kind of beforeChange hook. Because you can actually get all "incoming files" from it. Something like that is being used here:https://github.com/payloadcms/plugin-cloud/blob/main/src/hooks/beforeChange.ts#L21
Maybe that helps figure something out!
Might be completely wrong there though
I don't know the exact solution to this
I ended up going that route but was hoping there was a cleaner/proper way. I can access the files but by the time that beforeChange runs, they are already written to disk unfortunately.
My next step is to disable the local storage and write to the disk myself with the modified files 🤞
that sounds like a good plan tbh!
Get help straight from the Payload team with an Enterprise License.