0

I need to upload a file from a full javascript frontend.

I have a SOAP webservice that upload a file to a repository. The file is encoded in base64 inside the SOAP body.

Can I use the APIC to create a file upload REST endpoint that read the stream, encode in base64, and call the SOAP webservice on the backend?

Is it correct/safe/robust to do this on the integration layer, or I should do it on the backend?

Alessandro
  • 303
  • 4
  • 12

1 Answers1

1

Initially, I see two ways of going about this.

1) (Preferred) Handle the transformation on the backend. The gateway is not going to be good at transforming a file to base64. I'm not sure it's even possible, but either way--not a good idea.

2) You could try encoding the file sa base64 on the browser before sending it through the REST API. Doing that is likely only possible on modern-ish browsers. See this answer for more info: Get Base64 encode file-data from Input Form

Community
  • 1
  • 1
Matt Hamann
  • 1,488
  • 12
  • 24