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.

Modifying plugin-cloud-storage's handleUpload

default discord avatar
domosaurus2 years ago

Hi, is it possible to modify

plugin-cloud-storage

's

handleUpload

function like how I can modify the

generateFileURL

function, ex:



plugins: [
  cloudStorage({
    collections: {
      media: { adapter: <adapter>, generateFileURL: generateFileURL,              handleUpload: <modify_here> } 
    }
  })
]


I can see in the docs that

generateFileURL

is exposed to be overwritten, I was wondering if

handleUpload

could also be overwritten



oop found it, ended up doing something like this:


plugins: [
  cloudStorage({
    collections: {
      media: { adapter: () => ({ ...{}, handleUpload }), generateFileURL: generateFileURL } 
    }
  })
]
    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.