How to do the path for the custom image to the block field

default discord avatar
11 months ago

I have something like this:

    imageURL: "../images/mediaAndText.jpg",

Causing an issue like in the attached screenshot.

I'm probably missing something obvious here?

Also here is my project structure

  • discord user avatar
    Payload Team
    11 months ago

    In your console, what URL is it trying to resolve for the images?

    Relative paths won't cut it here. You'll have to point it to where they're served from

  • default discord avatar
    11 months ago

    @denolfe, you're right and can I serve it from Payload or do I need to upload it to somewhere else? Here is what I get as the image source:

    <img src="../images/mediaAndText.jpg">
  • default discord avatar
    11 months ago

    You'll need to configure


    as static directory using express.static

    and then you can use something like

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!


Connect with the Payload Community on Discord



Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.