klis87 / django-cloudinary-storage

Django package that provides Cloudinary storages for both media and static files as well as management commands for removing unnecessary files.
MIT License
131 stars 26 forks source link

Can I set uppload option to private? #32

Open kiey opened 3 years ago

kiey commented 3 years ago

Hi, first thanks for the amazing project!

I want to upload my files in private mode, so they are only accessible by my application, is it possible with this backend?

I have checked the documentation and I haven't found anything regarding private mode.

Thanks!

klis87 commented 3 years ago

Hi, I am glad you like it!

What do you mean by a private mode? Is this a Django feature, or maybe a Cloudinary feature?

kiey commented 3 years ago

Hi, It is a Cloudinary feature, by default files are upload publicly (everybody can access them) if I want to use it as backend on my application I need to have the files only accessible by the application. To achieve this, a parameter type has to be past with "private" as value. From the documentation there is this example: cloudinary.uploader.upload("sample.jpg", type = "private")

From the section Private Assets https://cloudinary.com/documentation/upload_images

klis87 commented 3 years ago

I see, another question, how a given image could be seen then despite being private, is there anything to be done on reading side too?

kiey commented 3 years ago

I am not sure of what is the specific way of doing it, I should do a bit of testing to understand it. Whenever I have sometime, I will check it out

The information should be here in case you want to give it a look https://cloudinary.com/documentation/control_access_to_media

klis87 commented 3 years ago

Ok, thx, so once we know the way to read private cloudinary files, we could think of adding this feature to this library!