Comments (9)
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.
I'll be taking this on in a short while.
from attachinary.
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.
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.
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.
Try Cloudinary::Utils.cloudinary_url
.
https://github.com/cloudinary/cloudinary_gem/blob/master/lib/cloudinary/utils.rb#L211-L218.
from attachinary.
@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.
@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.
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)
- Dependency on old version of cloudinary gem HOT 4
- The attachment files options may be serialized in the wrong way
- Problem implementing has_attachments HOT 1
- destroy_file callback not invoked HOT 4
- File instances break on serialization w/ active model serializers
- Validate presence error message
- undefined method `has_attachment' HOT 3
- Rails 5.1 HOT 9
- Using with administrate gem HOT 1
- limit min and max file size upload HOT 2
- rake attachinary:install:migrations -> Index table names are too long HOT 2
- ArgumentError Exception: too few arguments
- Destroy attachinary
- Chunked video upload HOT 1
- Attachinary::File::ActiveRecord_Associations_CollectionProxy:0x007fa5fbada388
- Issue with `process_input` function with Rails 5 Parameters
- Add custom filed to attachinary
- Handling video files better
- CORS endpoint echoes unsafe JSON / Potential XSS
- attachinary_file_field as required
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from attachinary.