Upload file to Web API(Mulesoft) using Multipart/form-data
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
22-04-21 09:11 AM
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.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
28-04-21 09:33 PM
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.
The configuration is pretty straight forward. In the headers I've added Content-Type: application/json
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.
The configuration is pretty straight forward. In the headers I've added Content-Type: application/json
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
29-04-21 01:37 PM
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
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
