#Save custom media URL on database

1 messages · Page 1 of 1 (latest)

normal vessel
#

Hi all, I'm using the plugin to upload my media to UploadThing, except that the url generated on the frontend is not the URL of my Uploadthing images, which therefore causes problems when deploying my app, I realized that the “url” field was empty for all my media in the database, could someone help me? Thanks in advance!

stable kayakBOT
cedar bough
#

Were you able to resolve it? I am facing a similar issue where I have uploaded images to AWS S3 bucket and I am trying to save that URL into db but facing some errors.
I did not get any response from anyone

plain stirrup
#

any updates? were you able to resolve it? I'm facing the same problem and its getting extremely frustrating, I'm one step away to moving to another cms.
I'm using uploadthing plugin with sqlite db, I just wanna save the URL from uploadthing in my database, payload always saving it as localhost:3000/api/media/..... , and I can't figure out how to change that behavior

plain stirrup
#

Solved: https://payloadcms.com/docs/upload/storage-adapters#payload-access-control
struggled to find it, brain can't read because adhd, but heres the solution:

uploadthingStorage({
      collections: {
        media: { disablePayloadAccessControl: true },//<----- Add this line 
      },

      options: {
        token: process.env.UPLOADTHING_TOKEN,
        acl: 'public-read',
      },

      enabled: true,
    }),
Payload

Payload is a headless CMS and application framework built with TypeScript, Node.js, React and MongoDB

#

I just wish it was titled something like: Save Custom URL for media to the database

#

Wait what im talking about it doesn't even save it to the database, theres a media but url is empty