I want to pass or upload the excel file from UI to rest API to exceute one of my processhow do I that ?
Hi Nikil,
You could just pass the excel as binary data in your exposed API and do the required logic in your action:
Hallo @Nikhil Jagtap ,
can you use binary Conversation https://success.outsystems.com/documentation/10/reference/outsystems_apis/binarydata_api/
@Nikhil Jagtap : What exact issue you are facing while invoking the REST API from client / screen action ? Is this REST API hosted by OutSystems or from other sources ?
HI @Nikhil Jagtap,
There’s already a solution for the issue discussed. Please check out this link for more information.
https://www.outsystems.com/forums/discussion/56543/consume-rest-api-to-upload-file-in-outsystems-mobile/
Thanks,
Kundan
Thanks for the information.I will check it out.
There are multiple ways to upload a file to an exposed REST API. The most widely used way is to perform a multipart upload. The advantage opposed to the proposed solution above (just a Binary Data input) is that you are also able to get the filename plus optional additional data in a single request.
To parse a multipart post you would have to add a component to your factory like this one https://www.outsystems.com/forge/component-overview/4026/multipart-form-data-o11
The second way is to use a binary data only like proposed above. Without the filename you would have to apply other techniques to identify the MIME type of the binary data. Search the forge for magic numbers for a component that allows to identity the MIME type from a binary data only.
The third option is to convert the binary data on client side in a base64 string and send this along with additional json data to your API.