cancel
Showing results for 
Search instead for 
Did you mean: 

Upload file to Web API(Mulesoft) using Multipart/form-data

SireeshaJaggems
Level 3
When trying to upload file(txt,pdf,excel,image etc),  the file content is getting corrupted. I tried both template configuration and HTTP VBO as well. Request includes headers and attributes as well .Could you please share the configuration required. Attaching the logs and input form (from api end) for reference.
36108.png
36109.png
2 REPLIES 2

AdamGaulding
Staff
Staff
I'm not using a VBO for the HTTP call. I'm using the built in WebAPI Configurator in Blue Prism. 

In the object I have the file that I want to upload as a Binary Data Item and I pass that as an input for the webapi action.

36106.jpg

The configuration is pretty straight forward. In the headers I've added Content-Type: application/json
36107.jpg

Hi, Sireesha,

Blue Prism Web API works well, however, it sends the file in base64 encoded as a string. If the target expects binary format you need to write a custom code stage which does it. If you can download RestSharp.dll and I am attaching VBO which sends the file in binary format to the target. 

I am not sure if this helps in your case but recently I discovered this in my use case and the reason was really that through Web API it is sent as base64 encoded.

Regards,

Zdenek