cancel
Showing results for 
Search instead for 
Did you mean: 

multi-part form data from CPI using zip file

0 Kudos

HI,

I am trying to send a zip file containing a csv file to Ariba using CPI. I have tried using postman tool and it is working fine. I wanted to test this with CPI by hardcoding the message body in content modifier.

in first content modifier I have csv file as it needed for target application

UTF-8,,

DepartmentID,Parent

1212,2323

next step I have used "Gather" step to zip the csv file

next content modifier I have hardcoded below in message body tab

----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="event"

Import Master Batch Data

----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="fullload"

True

----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="sharedsecret"

xsdsddsd

----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="clienttype"

Postman

----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="clientinfo"

Postman version 3.0

----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="clientversion"

3.0

----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="content"; filename="Departments.zip"

Content-Type: application/zip

${body}

----WebKitFormBoundary7MA4YWxkTrZu0gW--

I am calling this iflow from postman ( no body / no header ) and I get below error

Throwable caught: Unexpected Error || invalid distance too far back: [Ljava.lang.StackTraceElement;@17bc2bae

I feel the zip file is not generated properly . Any suggestions what is missing here?

deschrijverp joao_miguel_17 sriprasadshivaramabhat sriprasad.shivarambhat

Accepted Solutions (0)

Answers (2)

Answers (2)

HI,

The issue is resolved by following the code written by pharswan.sunil

SAP CPI - Forwarding Raw Image Data through Integration Flow | SAP Community

former_member71230
Discoverer
0 Kudos

@bhattasankar

Hi Sankara,

We have a similar requirement where we need to send data to Ariba. First, we need to pick up a CSV file from SFTP, ZIP it and send it in form of multipart form data. We have followed your blog and we are getting "Throwable caught: Illegal filename: ID-vsa10692304-1668261292152-120-2 || No stack available."

Can you please help us to troubleshoot this error?

Thanks,

Jeevitha

Sunil_Pharswan
Explorer

Hi bhattasankar ,

It is great to hear that the code snippet helped.

Cheers.

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Sankar,

Please make sure you have multipart header with boundary value mentioned.

<code>Content-Type: multipart/form-data; boundary=<Your boundary value>

Refer below blog that might help you

https://blogs.sap.com/2019/11/14/what-is-form-data-and-how-to-send-it-from-sap-cloud-platform-integr...

Regards,

Sriprasad Shivaram Bhat

0 Kudos

HI Sriprasad,

I have followed the blog already and set the header value as it was suggested in blog. the only difference is I have zip file here in my case