danialfarid / ng-file-upload

Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support
MIT License
7.87k stars 1.6k forks source link

Trying to upload files in array of objects #2122

Open sameeranand2711 opened 4 years ago

sameeranand2711 commented 4 years ago

Hi,

I am trying to upload an array of objects where each object will have a list of attachments, something like:

var obj = { Description: '', RequestId: 'kjdsf9-dsfa', Items: [ { Description: '', Cost: 132.00, Files: [file1, file2]}, { Description: '', Cost: 461.25, Files: [file3, file4]} ] }

var promise = Upload.upload({ url: '/localhost/saveRequest', method: 'post', data: obj });

However, on the server, the Files array inside every object is null. Can we upload files as above? Or do we have to upload at the top level only.