General error on Uploader addTag Java call
Hi,
I got a new issue that strangely didn't occured before, a "General error" on the addTag method call in my file upload to Cloudinary Java implementation.
All I do is to obtain an uploader like this :
Cloudinary cloudinary = new Cloudinary();
Uploader uploader = cloudinary.uploader();
Create all I need in a config Map :
Map<String, String> config = new HashMap<>();
config.put("cloud_name", xxx);
config.put("api_key", yyy);
config.put("api_secret", zzz);
etc.
Then upload files with :
Map<String, String> res = uploader.upload(file, config);
So far everything's ok.
Then I want to add some tags like this
uploader.addTag('MyTag', new String[] {public_id}, config);
where public_id is the same public ID in the config Map.
The only thing I changed recently was to add this in the config Map :
config.put("resource_type", "auto");
The aim was to upload any type of file and not only images.
Did I miss something ?
Thanks in advance for any help,
-David-
-
Hi David,
The reason it is failing is that resource_type auto is not an acceptable parameter for addTag. You can check out the API described here: https://cloudinary.com/documentation/image_upload_api_reference#tags_method
Thanks,
Aditi
0 -
Hi Aditi
Thanks a lot for yourquick response ;)
It was my conclusion.
That means that I must use to different configs, with some same parameters, one for the upload, the other for adding tags.
Regards,
-David-0
Post is closed for comments.
Comments
2 comments