Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Images get deleted on Northflank

default discord avatar
olivier_vd2 years ago
10

I need some uploading media. Whenever I upload something on Payload it seems to be working or resolving for a while but then the link breaks and the resource can't be fetched any longer.



fe.

https://p01--admin-cms--qbt6mytl828m.code.run/media/collection_ding_ex-1.png



this is my code for adding media to the collection;


https://github.com/oliviervd/cms-studios/blob/main/src/collections/Media.ts

do I perhaps need to change some settings on MongoAtlasDB?

  • default discord avatar
    notchr2 years ago

    Good morning

    @688702717279076387

    , this is definitely a weird issue.



    I'm not sure that it's related to Payload, but happy to help troubleshoot

  • default discord avatar
    olivier_vd2 years ago

    could it be related to updating the code for the collection? - it seems stable now without changing anything to the repo

  • default discord avatar
    notchr2 years ago

    Ah, changing your collection may have been related



    But it's hard to know for sure

  • discord user avatar
    jmikrut
    2 years ago
    @688702717279076387

    where are you deploying to? where are you storing your media?

  • discord user avatar
    alessiogr
    2 years ago

    judging from the domain, he's deploying to northflank



    (which uses ephemeral storage by default)

  • default discord avatar
    olivier_vd2 years ago

    Yes northflank!



    MongoAtlas for storage

  • discord user avatar
    alessiogr
    2 years ago

    You mean for the database?



    On northflank, everything stored on it actually gets deleted every time the project is re-built



    Including the images



    Because the default storage isn't persistent



    So you'd either need to store the images somewhere else (the cloud storage plugin may be helpful), or alternatively you can also set up permanent storage inside of notquests and mount that (I think in your Dockerfile) ^^

  • discord user avatar
    jarrod_not_jared
    2 years ago

    Images get deleted on Northflank

  • default discord avatar
    olivier_vd2 years ago

    can the plugin be connected to an MongoAtlasDB?

    @360823574644129795
  • discord user avatar
    alessiogr
    2 years ago

    Yep



    The plugin stores the images on some external service (like s3, cloudinary, imagekit etc) and on your Mongodb database, it just stores the

    link

    to the image, not the image itself

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.