Using an external URL for uploaded media

I’ve set up the WebDAV adapter for storing images in Ghost v2.27.0.

My Ghost is installed at snipette-ghost.herokuapp.com, while uploaded images are stored in a dedicated server, available through media.snipettemag.com.

However, when I upload an image via Ghost, it links to the image at snipette-ghost.herokuapp.com/content/…, which means the request goes to Ghost, which fetches it from the media server, and then displays it. I’d like to remove this roundabout step by making Ghost link images directly to media.snipettemag.com/… instead.

What’s the best way to go about this?

One option is to do a “find and replace” on the database every time Ghost saves an image, but that’s obviously not great. I’m guessing there’s some configuration required, either in the router system or in the adapter code, but I’m not sure which. Can anyone help out?

You can rewrite a save function in this adapter to return a image url as you want

This adapter was develped to ghost 1.x like mostly. Exist a risk that somo things are wrong. And not have any software test to show trust.

Captura%20de%20tela%20de%202019-10-03%2020-28-19|690x164

Thanks @luizamboni, I’ll try what you suggest and see if it works.

Yes, I hope to eventually write my own adapter, once I figure out how to make it work.