Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for store all uploaded files such as video,pdf etc. #156

Open
anuragkumar19 opened this issue Oct 31, 2022 · 2 comments
Open

Support for store all uploaded files such as video,pdf etc. #156

anuragkumar19 opened this issue Oct 31, 2022 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@anuragkumar19
Copy link

@eexit I am using this plugin with ghost self-hosted sever. I noticed that this plugin only manage images with cloudinary. Ghost also provide facility of uploading video, audio etc. to sever. When I upload other file it get uploaded to local file storage of my server. But in order to make my app state less I have to store all the uploaded files to cloudinary. I thinks its best add support for it to the library.

Thanks!

@eexit
Copy link
Owner

eexit commented Nov 2, 2022

Hey @anuragkumar19,

A good start would be "Hello".

This storage adapter has been out there since pre-version 1 of Ghost and according to my research, it's not been a year since Ghost allows any file types to be uploaded. It takes time to track all Ghost features 😉

It seems like Cloudinary allows to upload any kind of file, which is excellent. Now, we only need to implement and test this.

Want to contribute?

Thanks!

@eexit eexit added enhancement New feature or request help wanted Extra attention is needed labels Nov 2, 2022
@anuragkumar19
Copy link
Author

Hi! @eexit
I was trying to find a way to do it. After a bit of reasearch I found that we can do that very easily with little bit of change.

"storage": {
        "active": "LocalImagesStorage",
        "media": "LocalMediaStorage",
        "files": "LocalFilesStorage",
        "LocalMediaStorage": {},
        "LocalFilesStorage": {}
    },

Source: https://github.com/TryGhost/Ghost/blob/fa1861aad3ba4e5e1797cec346f775c5931ca856/ghost/core/core/shared/config/defaults.json

They use key:-active for image adapter which didn't hint me at first that there exist other configuration otions like media,files which I can configure to make my work done. But going through the files led me this.

We have to write two more files one for files and one for media and rename the index file. Now we have to move dirctly in content/storage/adapter instead of content/adapters/storage/ghost-storage-cloudinary. As these are major changes and break the other application running. We have to release a new major version.

CloudinaryImagesStorage.js
CloudinaryMediaStorage.js
CloudinaryFilesStorage.js

New conf:

"storage": {
        "active": "CloudinaryImagesStorage",
        "media": "CloudinaryMediaStorage",
        "files": "CloudinaryFilesStorage",
        "CloudinaryMediaStorage": {},
        "CloudinaryFilesStorage": {},
        "CloudinaryImagesStorage": {},
    },

We have another option to create two other library one for media and one for files. It will not break the other application and people who want to use this feature just add that libraries.

Waiting for your opinion on this.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants