Url suffix with java client doesn't allow dots in suffix
Hi,
if I try to set an url suffix according to
https://cloudinary.com/blog/how_to_dynamically_create_seo_friendly_urls_for_your_site_s_images
e.g. https://demo-res.cloudinary.com/images/ltepu4mm0qzw6lkfxt1m/baloncesto-juego-en-universidad.jpg
I always get an exception when trying to execute code like that:
String url = cloudinary.url().transformation(transformation).source("zzz").suffix("sample.jpg").generate();
The exception says that
java.lang.IllegalArgumentException: url_suffix should not include . or /
and is thrown by:
How is it possible to create an url with an suffix that contains a '.' like 'image.jpg'? I already tried to url encode the '.' that doesn't cause the exception, but it doesn't decode the dot in the suffix as well.
Thanks, Martin
-
Hi Martin,
Adding an extension to the URL should be done using the `format` parameter, like this:
String url = cloudinary.url().transformation(transformation).source("zzz").suffix("sample").format("jpg").generate();Let me know if this works for you?
0 -
Thanks Roee, that solution provides the expected link.
0
Post is closed for comments.
Comments
2 comments