Can I use Cloudinary direct upload with a client of my API
We run a Rails API which uses the Cloudinary CarrierWave integration (api.givey.com). We are interested in using the direct upload facility on the API client (a separate Rails application www.givey.com) to then send the image_id back to the server to be attached to the model.
Is this architecture possible, or are there complications involved because it is technically not the same application?
0
-
Hi Nick,
We can suggest 3 possible solutions for that:
- When the uploading to Cloudinary is done (e.g., bind to the 'cloudinarydone' jQuery event), perform an Ajax call to the origin server of www.givey.com that will update api.givey.com using an internal call on the server-side (no CORS permission issues).
- Set the
notification_url
parameter when uploading to Cloudinary. The value can be a URL of api.givey.com that would receive a POST request with the upload details when uploading is completed. See the following post for more details: http://cloudinary.com/blog/webhooks_upload_notifications_and_background_image_processing - When uploading is completed, perform an Ajax call from the page of www.givey.com to api.givey.com. This requires either using modern CORS headers or setting document.domain to ' givey.com' (see: http://stackoverflow.com/questions/745831/does-setting-document-domain-work-in-all-most-browsers)
0
Post is closed for comments.
Comments
1 comment