Expand my Community achievements bar.

SOLVED

What is the ecoding format of assets stored in CRXDE.

Avatar

Level 7

When I am hitting this 

through postman
PK��������z��/?����*�L��%0"S1�W3<=�d����:1O���"w��.�����1��&��OSt�#$�$V5�aa�͊��p��IC�1��
I am getting data in above format.
akshaybhujbale_0-1660140503912.png

and in crxde it is showing in binary.

How i can convert this encoded file content into readable trext.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @akshaybhujbale,

For word doc there is something like plain rendition that represents content as a plain text (it even can be checked directly from crx) without any formatting etc. Not sure if this will fulfill your requirement but it's definitely worth to explore this option.

crx_word_plain_txt.jpg

So in that case, you can try url like this: http://localhost:4502/api/assets/wordFile.docx/renditions/plain

I have checked above with curl and got plain text of my word document as a response. To be clear I was testing this on AEM 6.5.12.

However if you would like to keep formatting etc, then in my opinion you should send this as binary file, and properly transform/consume on the system that you will be hitting AEM from.

View solution in original post

5 Replies

Avatar

Community Advisor

try saving the response as docx and check?



Arun Patidar

Avatar

Level 7

Hi @arunpatidar 

But I dont want to save this response I want to push this content to somewhere else 

so how I can decode this to redable text?

Which endoding format is is using

 

Avatar

Correct answer by
Community Advisor

Hi @akshaybhujbale,

For word doc there is something like plain rendition that represents content as a plain text (it even can be checked directly from crx) without any formatting etc. Not sure if this will fulfill your requirement but it's definitely worth to explore this option.

crx_word_plain_txt.jpg

So in that case, you can try url like this: http://localhost:4502/api/assets/wordFile.docx/renditions/plain

I have checked above with curl and got plain text of my word document as a response. To be clear I was testing this on AEM 6.5.12.

However if you would like to keep formatting etc, then in my opinion you should send this as binary file, and properly transform/consume on the system that you will be hitting AEM from.

Avatar

Employee Advisor

To read the binary data earlier I have referred following link: https://www.bhasaka.com/write-read-binary-data-into-from-jcr-node/

 

Check this if it helps.