Skip to content

Images uploaded before activating this adapter return 404 #152

@jslvtr

Description

@jslvtr

Hello!

I've been using the default Ghost storage adapter for a while, and have got a few year's worth of images in my content/images/ folder.

Recently though I've switched to using Cloudinary for my image storage, and I've activated this adapter.

However all my old images no longer work. Let's say I'm requesting image 2022/05/Untitled.png. This is what happens:

  • Ghost responds with 301 for {domain}/content/images/2022/05/Untitled.png, redirecting to {domain}/content/images/2022/05/untitled.png.
  • Ghost responds with 404 for {domain}/content/images/2022/05/untitled.png (makes sense, the image doesn't exist)

What I'm not sure about is why the original 301 response!

Deactivating this storage adapter and going back to the default one fixes the problem. No more 301s, and therefore no more 404s.

Looking through the code, I can't see anywhere in this storage adapter that would fall back to the filesystem (but also I don't know much about the code).

Should it fall back to the filesystem if the image is not found in Cloudinary? Or are we expected to migrate all our in-post images to Cloudinary before switching the adapter?

Looking at previous issues and PRs I found #90 which was closed without merging, seems like it adds this missing functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpluginNew plugin or plugin feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions