on 11-01-2019 6:55 AM
Hello All,
I have scenario where I need to post multipart form .pdf file to http client using SAP CPI.
Data should be in the below format
Content-Type: multipart/form-data
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="Field1"
Value1
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="Field2"
Value2
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="Field3"
Value3
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="file.pdf"
Content-Type: application/pdf
Payload
----WebKitFormBoundary7MA4YWxkTrZu0gW--
I tried to use the content modifier but my payload is getting corrupted. tried to follow the blog
https://answers.sap.com/questions/12716088/sap-cpi-forwarding-raw-image-data-through-integrat.html
But by using mail library I can't set multiple body parameters.
I tried to use the below library in my groovy script, but MultipartEntityBuilder throwing exception.
org.apache.http.entity.mime.MultipartEntityBuilder;
Could someone please suggest me the right approach.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello! All good?
I come across the same doubt.
I'm trying to upload .PDF files to Azure Blob using open connector. As soon as I check them there and download them to my machine, I see that they are corrupt...
I've been researching about the multipart/form-data structure, the MIME Multipart Encoder component and etc, but I haven't been successful yet. In the end the file is corrupted.
User | Count |
---|---|
76 | |
10 | |
8 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.