I’m writing this story partly for my future self — so I’ll have this recipe at my fingertips if I ever need to do it again — and partly for others, to hopefully spare some poor souls some of the pain that I just went through.

Prologue

I inherited a task to implement a file upload feature in our Angular 8 app.

What made this task a bit different than a typical file upload was that we weren’t uploading directly to the file storage server, we were uploading to our intermediate Node server (owned by the Frontend team, my team) which then POSTed to the final destination file storage microservice (owned by the Backend team).

This was new to me, as well as to the rest of the team, so research was required.

If I had been looking to POST form-data from the browser directly to the file storage server, I would have been on  Easy Street, as I discovered a sea of relevant and helpful resources.

#javascript #angular #rxjs #nodejs #file-upload

How to Upload a File from an Angular App using a JSON POST rather than form-data
15.15 GEEK