Giter Club home page Giter Club logo

Comments (9)

assembler avatar assembler commented on July 17, 2024

Thanks for the suggestion. I've checked those docs and see that it is possible, but just not currently supported by attachinary. I'll add it to my list. In the mean time, you can fork the project and change the Cloudinary::Uploader.upload call to include type: 'private' option.

from attachinary.

maletor avatar maletor commented on July 17, 2024

I'll be taking this on in a short while.

from attachinary.

kbaum avatar kbaum commented on July 17, 2024

Any update on this one? I have a need of storing private documents and i am thinking of using carrierwave but attachinary is so much easier to use. With carrierwave i have to create an extra AR model as it will be a has_many documents situation. As a side note, these documents can be anything.. word, pdf, images.. etc.

from attachinary.

maletor avatar maletor commented on July 17, 2024

Yes, attachinary already supports this. You must modify data-form to have
the private flag. Also, the attachinary response will tell you if the file
uploaded is an image or "raw".

http://cloudinary.com/documentation/upload_images

On Thu, Aug 1, 2013 at 6:57 AM, Karl Baum [email protected] wrote:

Any update on this one? I have a need of storing private documents and i
am thinking of using carrierwave but attachinary is so much easier to use.
With carrierwave i have to create an extra AR model as it will be a
has_many documents situation. As a side note, these documents can be
anything.. word, pdf, images.. etc.


Reply to this email directly or view it on GitHubhttps://github.com//issues/57#issuecomment-21937836
.

from attachinary.

kbaum avatar kbaum commented on July 17, 2024

Awesome! Once i upload a private file to cloudinary, how can we access it? For example, s3 has an expiring url that i can temporarily give to a user once they have been authorized.

thx!

from attachinary.

maletor avatar maletor commented on July 17, 2024

Try Cloudinary::Utils.cloudinary_url.

https://github.com/cloudinary/cloudinary_gem/blob/master/lib/cloudinary/utils.rb#L211-L218.

from attachinary.

kbaum avatar kbaum commented on July 17, 2024

@maletor - I see attachinary already takes care of the data-form-data attribute for me. What's the cleanest way to add a configuration parameter to this?

thx!

from attachinary.

kbaum avatar kbaum commented on July 17, 2024

@maletor - i figured out how to pass the data-form-data attributes. My code looks like:

= f.attachinary_file_field :documents, cloudinary: { type: :private, resource_type: :raw, transformation: :attachment, use_filename: true, image_metadata: true, discard_original_filename: false }

But i get an error back from cloudinary:

{"error":{"message":"Invalid value private for parameter raw_kind"}}

If i remove type:private, it works.

thx!

-karl

from attachinary.

kbaum avatar kbaum commented on July 17, 2024

Ok, was able to get private uploads working, but not with a raw file type. The following code works when attaching an image:

= f.attachinary_file_field :documents, cloudinary: { type: :private }

But it does not work if i attach a raw file type like an xls document. Along the same lines, the following code, never works as I am explicitly passing in raw:

= f.attachinary_file_field :documents, cloudinary: { type: :private, resource_type: :raw }

I get back the following error from cloudinary:

{"error":{"message":"Invalid value private for parameter raw_kind"}}

thx!

from attachinary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.