Hey everyone,
I have a question related to uploads. I'm building a gated content library for a client (funnily enough is a suggested use case for uploads -
https://payloadcms.com/docs/upload/overview#uploads:~:text=Gated%20Content%20library)
I created a Media Collection locally (localhost) and uploaded a file. I see that as-per my schema it created an asset folder called 'media' and uploaded the file there. Bam (as
@364124941832159242would say) nice and easy, so I love that.
are specifically about hosting this and how uploads would then work:
1. Let's say I hosted with Digital Ocean, and I upload a file, would Payload be able to create the media folder on the Digital Ocean server and upload the file to it without any additional configuration?
2. Assuming my frontend UI uses Next.js to
buildthe site, would I have to trigger a build every time a file is uploaded or could I fetch the uploads in a more dynamic way?
3. It looks like the media folder created is created as part of my Git repo, so would I have to store all of the files on GitHub as well as on Digital Ocean? They are going to have 100's of GB's worth of files stored so that could become an issue.
Really hoping someone can help me understand this as I'm just trying to understand it before passing a cost onto the client. I don't want to get caught out!
Bump
Thanks
@364124941832159242— I'm just looking further into using Digital Ocean to host Payload and my website, but the guide linked in the Payload docs is mostly just linking out to Digital Ocean articles. Is there anything more cohesive I could look at that I'm missing?
I have more questions regarding setting up Digital Ocean than I could suitably ask here. I'm not a dev ops person at all and have been comfortably letting Vercel handle all of this for me for years now so diving into SSH and running nginx etc is a little overwhelming for me.
Hey
@392646823015219203here are some answers for you!
Let's say I hosted with Digital Ocean, and I upload a file, would Payload be able to create the media folder on the Digital Ocean server and upload the file to it without any additional configuration?
Yes! It's worth noting though that DigitalOcean has a lot of different ways to deploy a Payload app. Some will -keep- your file system around, like Droplets, where others like the App Platform have a file system that completely re-inits once and a while (deleting your app folder) . You can host files on a Droplet no problem, but on the app platform, you'll need a third-party storage platform
Assuming my frontend UI uses Next.js to build the site, would I have to trigger a build every time a file is uploaded or could I fetch the uploads in a more dynamic way?
Nope, no rebuild necessary! Payload will serve the new files completely dynamically!
It looks like the media folder created is created as part of my Git repo, so would I have to store all of the files on GitHub as well as on Digital Ocean? They are going to have 100's of GB's worth of files stored so that could become an issue.
You will want to add your media folder to your
.gitignore
file. The uploads should be stored on your server, and not be included in your Git repository
you can use Vercel Blob Storage for files
check this out - a one click deploy button for Payload on Vercel with Postgres + Blob Storage all configured for you
So with Payload V3 inside a nextjs app hosted on Vercel you would also need a third-party storage platform, right?
Star
Discord
online
Get dedicated engineering support directly from the Payload team.