How can I get size of the uploaded image in KBs or MBs while searching in Nuxeo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2020 07:05 AM
I am using below URL, request and headers. I want to get size of the image in KBs or MBs uploaded in Nuxeo. The key with dms: prefix are custom fields. How can I get the size?
Endpoint: /site/automation/Repository.Query
Request { "params" : { "query" : "select * from Document WHERE dms:case_id ='Test602' AND ecm:isTrashed = 0 AND dms:applicant_id = '0' AND dms:tenant_id = '1' AND ecm:versionVersionableId IS NULL ", "pageSize" : "30", "language" : "NXQL", "currentPageIndex" : "0" } }
Headers X-NXProperties:*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2020 12:30 PM
Hello,
The information is stored in the length
property of your blob, like in
"file:content": { "name": "Plane.png", "mime-type": "image/png", "encoding": "", "digestAlgorithm": "MD5", "digest": "97dd6ae79e4e6f3cb868b7cef4d4f8bb", "length": "268322", "data": "https://nightly.nuxeo.com/nuxeo/nxfile/default/0cce04fa-d030-4005-8060-7e8bd612e491/file:content/Plane.png?changeToken=3-0" },
The unit should be in bytes, so you have to make some conversions.
Regards
