#PayloadCMS Image URL Directly from S3 Storage
1 messages · Page 1 of 1 (latest)
Original message from @broken rover - Moved from #general message
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- Production Deployment - File storage - Using cloud storage providers
- Production Deployment - File storage - Persistent vs Ephemeral Filesystems
- Storage Adapters
- Storage Adapters - S3 Storage
- Storage Adapters - Uploadthing Storage
Community-Help:
Hey @broken rover
Yeah, see here: https://payloadcms.com/docs/upload/storage-adapters#payload-access-control
ha thanks, this will be very cost effective solution
My pleasure
Glad your issue was resolved! :tada: If you want to help make payload better, please give us a :star: on GitHub and review us - It helps us a lot.
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