Upload file Connector Function issue 500 Internal server Error

I’m developing a function to upload file to 3rd party system, eMaint. I use file input widget to select and upload a local file to cloud storage. the widget datasource would be input of Connector function, according to eMaint X5 instruction, file encode should be binary therefor content type in request header should be multipart, when I run app with connector, I got error msg Error executing trigger(s), I don’t know what’s root cause.

Connector function

File input widget in app, datasource type is file variable

I suspect the file binary content in variable uploadfile didn’t pass to connector at all. Or the header generate by Tulip connector doesn’t match eMaint X5 expected header.
Sample upload file API