project-flogo/contrib

Rest Trigger and Files

Closed this issue · 1 comments

Currently the rest trigger does not handle requests containing files. Should we add that feature in the main Rest trigger? Or should we have a different trigger to handle files ? @fm-tibco @mellistibco @abramvandergeest can you share your thoughts on this?

Currently, https://github.com/skothari-tibco/contrib/tree/rest_image/trigger/rest supports a single file. We can change it to handle multiple files.

Changes to the current trigger will include. Adding file setting in handler settings. And the type of the content would be map[multipart.FileHeader]multipat.File. We can also discuss on the format of output.

file setting in the handler setting will be the key which contains the files in the Http request.The Http request should of type multipart/form-data
The reason there is multipart.FileHeader as a part of output because it contains the name, type and size of the file. Getting this information form the multipart.File only would not be possible.

I think it makes sense to add the ability to add multiple files to a REST request makes sense, and to have it in the main rest trigger. I think that being able to send one file is a must with additional files being good but of lower priority (unless it makes sense to just do it that way from the beginning).