Add parent Document data to generateImageName function in upload.imageSizes definitions #14680
dtorres-nas
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working on a multi-tenant solution, I've been able to isolate Upload collections using the official multi-tenant solution. I've also implemented custom file names for our blob storage by adding a prefix folder name using the related tenant ID in
beforeChange. Then inafterReadI pull in the original filename for UI display and a custom CDN filename field is used for the link URL in admin.That all works for the original image, though using a bit of a workaround. However, I'm not able to add a prefix to the saved
imageSizesfile names, they still get saved at the base blob storage container instead of inside the virtual folder with the original image. Looking through the docs,generateImageNameseems like the exact function I need, but it doesn't provide the context I need to generate prefixed tenant filenames.With that in mind, it would be helpful if I had access to the Document data and relations within this function, allowing customization of the filename with a tenant ID or any other logic based on the Document relationships. Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions