cancel
Showing results for 
Search instead for 
Did you mean: 

Binary Attachment file through Form-Data not working in sap cpi

nidhi_srivastava22
Active Contributor
0 Kudos
214

Hi Experts,

I am working on a scenario where ServiceNow is sending attachment(any format img/pdf/ppt/.xls etc) in Base64 format to SAP CPI. SAP CPI decoder used and converted to binary format which needs to be sent to JIRA Api which accepts form data. 

While triggering the same binary file(taken from Trace) from POSTMAN it is posting successfully and the attachment is displayed in expected format. But the same thing is giving 500 Error from SAP CPI.

image.jpg

 

 

 

 

 

The flow is mentioned below where I am using the decoder to convert to binary. Setting multi-part header through Content modifier but it is not working.

nidhi_srivastava22_1-1737373833357.png

I tried using the groovy scripts from the below two blogs to solve my issue but no luck.

https://community.sap.com/t5/technology-q-a/sap-cpi-forwarding-raw-image-data-through-integration-fl...

Error Details 

nidhi_srivastava22_2-1737375217643.png

Please guide me how can this be resolved.

Thanks.

Best Regards,

Nidhi Srivastava

 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

PRanavMalhotra
Discoverer
0 Kudos

Hi @nidhi_srivastava22  ,

your form-data body is not properly formatted (like boundary is not defined properly please refer form-data guideline) .Try creating it through groovy script and make sure you converted whole payload to bytes before pushing it to API .  Hope this helps ! Thankyou

nidhi_srivastava22
Active Contributor
0 Kudos

Hi Pranav,

I tried using the script from the answer to the below blog but still i am getting HTTP 500 error.

https://community.sap.com/t5/technology-q-a/sap-cpi-forwarding-raw-image-data-through-integration-fl...

I am not very sure, where things are going wrong.

Thanks,

Nidhi Srivastava