How can I simulate form upload?

I have found myself in the situation in which I must implement a form upload from the OutSystems environment to a web service.  I have tested it successfully using Postman

POST /core/upload?path=/helpdesk/SharedFolder HTTP/1.1
Host: horizon.filecloudonline.com
cache-control: no-cache
Postman-Token: 9f936b7a-2c55-4590-ba3b-589bb1443128
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW

Content-Disposition: form-data; name="GEPower.png"; filename="C:\Users\dschuler\Pictures\GEPower.png


------WebKitFormBoundary7MA4YWxkTrZu0gW--

Now I need to translate that into the OutSystems environment, preferably using the ardoHTTP component, and I thought I would seek the advice of the OutSystems wizards on the Forum.  I think that doing the above is imprudent for security reasons but that is beyond my control.

How should I proceed?

Something like this:

Headers

========

Content-Type: multipart/form-data;boundary=----OutSystemsUploadxxxx20190326

Content-Disposition: form-data; name="GEPower.png"

Body

====

------OutSystemsUploadxxxx20190326

{contents of file}

------OutSystemsUploadxxxx20190326--


Hello Dave,

I would recommend you take a look at the following blog post:

https://www.outsystems.com/blog/posts/consuming-multipart-form-data-rest-method/

The blog explains how to use Multipart-form data and mentions a component available on Forge that takes care of most of the complexity. You can find the component below:

https://www.outsystems.com/forge/component-overview/4026/multipart-form-data

Hope this helps ;)

Thank you very much.  That appears to be very relevant and I know that Kilian Hekhuis is an ace, i.e. a highly reliable source so that very well might be what I am looking for.  I will take a look at it.

I have implemented a test app using the Multipart/form-data component following the instructions in the blog post linked above as closely as I could.  Just before the end of the OnBeforeRequest action I checked every element as closely as I could and everything looked fine.

It did not work.   Is there any way I can check the actual request that's being emitted?  That might give me a clue.  The web service to which I am issuing the request is extremely opaque--it provides no help in diagnosing my problem.  All we know now is that it works when we do make the request in Postman and does not when we make it in OS.

 Dave Schuler wrote:

I have implemented a test app using the Multipart/form-data component following the instructions in the blog post linked above as closely as I could.  Just before the end of the OnBeforeRequest action I checked every element as closely as I could and everything looked fine.

It did not work.   Is there any way I can check the actual request that's being emitted?  That might give me a clue.  The web service to which I am issuing the request is extremely opaque--it provides no help in diagnosing my problem.  All we know now is that it works when we do make the request in Postman and does not when we make it in OS.

Hello Dave, 


Without having access to proper documenation it's hard to troubleshoot this type of situations.

In my experience, this usually boils down to not passing the correct form values into the call.

I've attached a sample demonstrating the use of the multipart-form-data component. The code has some comments explaining the usage.


Hope this helps