django-cloudinary-storage icon indicating copy to clipboard operation
django-cloudinary-storage copied to clipboard

Can I set uppload option to private?

Open kiey opened this issue 4 years ago • 5 comments

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!

kiey avatar Sep 01 '21 07:09 kiey

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?

klis87 avatar Sep 01 '21 14:09 klis87

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

kiey avatar Sep 01 '21 14:09 kiey

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?

klis87 avatar Sep 01 '21 22:09 klis87

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

kiey avatar Sep 02 '21 12:09 kiey

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

klis87 avatar Sep 02 '21 13:09 klis87