How can I set adv_ocr:document on an upload preset?
I am using an unsigned upload preset for my uploads because I also need access control mode set to restricted, which is not possible to set directly on the SDK upload method call. On the preset, I have OCR set to adv_ocr, but what I would like is to set it to adv_ocr:document. However, I do not see the option to do this in the settings. What do you advice?
-
Official comment
Hi Gitahi.
Thanks for your question. Certain advanced components of an upload preset need to be created via the API instead, as the UI has some limitations. I've gone ahead and created the Upload Preset
unsigned_ocr_document
in your account which usesadv_ocr:document
, using the following little Node script:cloudinary.v2.api.create_upload_preset(
{ name: "unsigned_ocr_document",
unsigned: true,
invalidate: true,
use_filename: true,
unique_filename: true,
type: 'upload',
ocr: 'adv_ocr:document',
auto_tagging: '0.7',
access_control: '[{"access_type":"token"}]'
})
.then(result => {console.log(result)})
.catch(error => {console.log(error)});I hope this helps. Please let me know if you encounter any issues.
Many thanks,
-Danny -
This works. Thank you.
0
Post is closed for comments.
Comments
2 comments