0
votes

I followed this tutorial: https://valor-software.com/ng2-file-upload/

It works just fine with Postman but when I try it in my app it doesn't. From the api I return files and I see them from Postman but get undefined in my app.

I did notice that in my app my request Content-Type is set to:

text/plain;charset=UTF-8

I tried to set to:

multipart/form-data

But then got a Boundry error.

Any suggestions?

1

1 Answers

0
votes

I changed this on the server:

@UseInterceptors(FileInterceptor('files'))

to:

@UseInterceptors(FileInterceptor('file'))

and it started to work, no idea why postman was working.