Hey
@283289115745845249
Yeah, see here:
https://payloadcms.com/docs/upload/storage-adapters#payload-access-controlha thanks, this will be very cost effective solution
My pleasure
in what case this is used?
For example in my frontend i dont want to fetch images from /api/media because this will make heavy request and not cost effective on vercel.
Is there another use-cases ?
I'm asking because I would not find it easy.
I did something similar for admin panel also:
// Media Collection
upload: {
disableLocalStorage: true,
// To not return images in /admin via /api -> this goes throught nextjs
adminThumbnail: ({ doc }) => {
return `${process.env.S3_URL}/${process.env.S3_BUCKET}/${doc.filename}`
},Is that good practice ?
That's exactly the use-case. It also means no excess computation for media collections which are already public facing
For adminThumbnail it's fine
Thank you man, you drive this community very hard 😄 hope paid enough
My pay is having users like you make super awesome projects with Payload hahah, again it's my pleasure
Star
Discord
online
Get dedicated engineering support directly from the Payload team.