Workflow
Hello I am hoping someone can help with with a simple question. The documentation is a little unclear. I want to be able to upload directly to cloudinary, store the url, then pull it back down and resize it, and the uploaded may have to rotate the image. I am using php. The other problem is the documentation always uses cl_image_tag, I just need the URL secured, not the HTML image tag. Any help would be greatly appreciated.
-
Hi Michael,
You can upload using the following method -
\Cloudinary\Uploader::upload("my_image.jpg")
This call returns an array with the `public_id` and the secure URL.
You can then add transformations to the URL and Cloudinary will perform them on-the-fly.
For more details, please refer to the PHP image upload guide.
-
Thank you for the response, I was able to easily upload, but its not clear how I convert the URL with transforms without using cl_image_tag. Do I just split apart the URL and reconstruct it with the parameters? Also a side question, if I add security for white labeled domains, can I used signed urls outside of white labeled domains? Thank you in advance.
-
Hey,
You can create dynamic transformations (on-the-fly) by simply altering the URL.
For example, transforming the original uploaded http://res.cloudinary.com/demo/image/upload/sample.jpg image with the "sepia" effect -
http://res.cloudinary.com/demo/image/upload/e_sepia/sample.jpg
You can also construct the url programmatically using the cloudinary_url method -
cloudinary_url("sample.jpg", array("width" => 100, "height" => 150, "crop" => "fill"))
For more information -
https://github.com/cloudinary/cloudinary_php
Regarding the security question, please open a support ticket and share some more details about your use-case and we will try to find the most suitable solution for you.
Post is closed for comments.
Comments
4 comments