Unsigned transformations
I need to upload to cloudinary directly from my frontend. To do so with javascript I need to use unsigned uploading. When using unsigned uploading it doesn't allow you to pass a transformations argument - the specific error is:
"Transformation parameter is not allowed when using unsigned upload. Only upload_preset,callback,public_id,folder,tags,context,face_coordinates,custom_coordinates upload parameters are allowed."
Putting aside how pointless this restriction is, is there anything wrong with uploading the image without transformations, manually editing the url to include them (i.e. adding '/a_exif,q_auto/' into the url) and then just referencing that url?
-
Hi Nikola,
You can set the transformation on your upload_preset and all the uploaded image will have that transformation.
You can also transform your images after upload by using one of the upload widget function
Eg: Once you have the response after image upload you can use one of the upload widget API like cloudinarywidgetfileuploadsuccess and transform the image:-
$.cloudinary.image(data.public_id, {
transformation: [{
width: ($("#width").val()),
height: ($("#height").val()),
crop: <crop_value>,
effect: <effect_value>
}, {
overlay: "text:Arial_40:" + str,
gravity: "south",
y: 80,
color: $("#color").val().toString()
}]
})For more information on API events: https://cloudinary.com/documentation/upload_widget#api_events
More information on upload presets: https://cloudinary.com/blog/centralized_control_for_image_upload_image_size_format_thumbnail_generation_tagging_and_more
Thanks,
Aditi
1
Post is closed for comments.
Comments
1 comment