cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to download in DMS using CAPM NodeJS

cdan
Explorer
0 Kudos

I am able to upload file and download file from postman successfully in DMS .Also completed the upload part from external file and I am able to download it from postman. I am getting the buffer but while performing from NodeJS get call for download using ?objectId='<value>' for downloading from my attachment(also passed responseType:buffer in get call). Also passed content-type: '<file-mime-type>',content-disposition. Still facing some issue when I use external service for downloading. For example, if I upload a png file I am not able to see the image. Any help would be appreciated.

View Entire Topic
KazuhikoTakata
Participant

Hi @cdan 

My post Extend Upload Set to Fiori Elements and utilize Do... - SAP Community may help you, when you are implementing CAPM Node.js.

Best regards,

Kazuhiko Takata

cdan
Explorer
0 Kudos
My issue is with the file when it downloads. When I upload from my CAPM Node JS, I am able to preview it from DMS API. But when I call the DMS API from my Node.js I am unable to dowload the array buffer returned in my service. Its previewing image in the following format
cdan
Explorer
0 Kudos
My issue is with the file when it downloads. When I upload from my CAPM Node JS, I am able to preview it from DMS API. But when I call the DMS API from my Node.js I am unable to dowload the array buffer returned in my service. Its previewing image in the following format �PNG\r\n\n\rIHDR<��[l�sRGB���gAMA�� �a\tpHYs���o�d��IDATx^��K�[�&t���Z{U�I!�E�Q�1��\r{&1B�c�����;���5Āb��\t'9��U`r(���w�����Ƙs�������G�{��|Ƹ�}��x���������_��~����#?��e��~�_�� ���������/� ��~�˂� ���G�˂� ���7�˂� ���7�˂� ���7�˂� ���7�˂� ���7����7���?~�͛7߾}�㏟� c^�>��6�������?~*���>~��R~��\r�7>�Z�6�ӗ�B�G�)�~��o"�~��#Fz�?/vѡ��C7YϿ\t������we��v����u�Տ3m�x1����-#�ӏ?��P���O>��oÛ~z h�|�� =>�K�14zP���4�������c��k1}�y…�p㉆/-�^jL��`�5��+�����w�ֆ���C�Re �^�OŒx�2�?�\\�ő&87Ĥ�^���+݅W�p'͔�����]�4��J�`F�?a�z �y�*qM���nF�o3`P�w���l>;mjV�H�kU#�c'KP*�K��b�s� �����^�rW*����K5�n�|�mV �x���.��x�\tzJ�Q�eьվ�;Y�&<��)F�sE?�G m/�nYP�Տ��/[��F.��O��ƹԓ��n�"�t:�z�.�LƓ�4}�$t�tl\n%��'2�s]��x�@a����վ���zY����،d�>9��TN� �;��\nT��%��JΒ�G�d{O]���೽������" 40�ב� �?�O��ƹg+n�|� `6k�l�Ͼ��K��������R���UM�\\z��a��O�"wl�e]2~ ����&�Q��4C��5A�^;%�]�M��Y������@��������-/���IEND�B`� and when I try to convert it to base64 it gives value which is a bit corrupted than the original value
KazuhikoTakata
Participant
Could you check source code of https://github.com/vneecious/sap-cap-sdm-plugin that I am using in my app. Or just use sap-cap-sdm-plugin like me.
cdan
Explorer
0 Kudos
Thank you so much for helping. I found the solution it was CAP interpreting any retrieved file as UTF-8 while this is not always matching the codeset of our file. So we have to use SAP Cloud SDK to bypass this UTF-8 conversion as it allows us to specify the Response Type to be the raw buffer which was also present within the plugin you used