colinmeinke / ghost-storage-adapter-s3

An AWS S3 storage adapter for Ghost
Other
183 stars 87 forks source link

RFE: add support for other file types #92

Closed iFloris closed 2 years ago

iFloris commented 2 years ago

Hello @colinmeinke I have been using your storage adapter with my ghost blog for some time now, and it has been working really great in combination with Wasabi. Recently, Ghost added the (long requested) option to attach files, videos and audio to a post or a page. But the S3 adapter currently only looks for image types. Hence this request for enhancement: I think it would be super helpful if your adapter could be expanded to add support for other file types. Is this something you would consider adding?

PavelPV commented 2 years ago

HI @iFloris . I faced the same issue as you. It looks that Ghost added more adapters for storage - LocalFilesStorage and LocalMediaStorage . So after updating config it started working for me with this adapter:

"storage": {
        "active": "s3",
        "media": "s3",
        "files": "s3",
...

Hope it will help.

iFloris commented 2 years ago

Hey @PavelPV thanks a lot! I will give that a try and update this comment.

Update: Yes, that does seem to work great! That's way easier than I thought it would be.

Perhaps that should be added to the readme @colinmeinke? Regardless, I will close this issue.

Azure-Agst commented 7 months ago

Not to necro, but I want to comment here for posterity:

This no longer works out of the box. Media adapters now require a function called urlToPath which is not defined in the BaseStorage class that the adapter derives from. I had to make a fork with a custom urlToPath function in it, and now media uploading works as expected.