{"action":"opened","issue":{"url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/886","labels_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/886/labels{/name}","comments_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/886/comments","events_url":"https://api.github.com/repos/danialfarid/ng-file-upload/issues/886/events","html_url":"https://github.com/danialfarid/ng-file-upload/issues/886","id":96413308,"number":886,"title":"Sending multiple files and Object to Spring Controller","user":{"login":"Runomu","id":10074880,"avatar_url":"https://avatars.githubusercontent.com/u/10074880?v=3","gravatar_id":"","url":"https://api.github.com/users/Runomu","html_url":"https://github.com/Runomu","followers_url":"https://api.github.com/users/Runomu/followers","following_url":"https://api.github.com/users/Runomu/following{/other_user}","gists_url":"https://api.github.com/users/Runomu/gists{/gist_id}","starred_url":"https://api.github.com/users/Runomu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Runomu/subscriptions","organizations_url":"https://api.github.com/users/Runomu/orgs","repos_url":"https://api.github.com/users/Runomu/repos","events_url":"https://api.github.com/users/Runomu/events{/privacy}","received_events_url":"https://api.github.com/users/Runomu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-21T20:50:50Z","updated_at":"2015-07-21T20:50:50Z","closed_at":null,"body":"Hi,\r\nim using this awesome plugin to upload multiple files and newsletter object to Spring Controller. i have been struggling with upload for hours. But I havent got it yet. my controller and js look like following. does anyone know, how can i send multiple files and object as requestbody\r\n\r\n\r\n\r\n@RequestMapping(method = RequestMethod.POST)\r\n    @ResponseBody\r\n    public Response createNewsletter(@RequestBody(required = true) Newsletter newsletter,\r\n                                     @RequestParam(value = \"files\", required = false) MultipartFile[] addedFiles)    throws IOException {\r\n        Newsletter createdNewsletter = newsletterService.create(newsletter, addedFiles);\r\n        return new Response(Response.STATUS_OK, \"Newsletter is succesfully created\", createdNewsletter);\r\n    }\r\n\r\n\r\n\r\n\r\n     var upload = function (newsletter) {\r\n            if ($scope.files && $scope.files.length) {\r\n\r\n                    Upload.upload({\r\n                        url: '/newsletters',\r\n                        file: $scope.files,\r\n                        headers: { 'Content-Type': 'multipart/form-data' },\r\n\r\n                       /* transformRequest: function(data){\r\n\r\n                            var formData = new FormData();\r\n                            formData.append(\"newsletter\",angular.toJson(data.newsletter));\r\n\r\n                          //  for(var i = 0; i < data.files; i++){\r\n                              //  formData.append(\"file\",data.files[0]);\r\n                           // }\r\n                            return formData;\r\n                        }, */\r\n                        data: {newsletter: newsletter}\r\n                    }).progress(function (evt) {\r\n                        var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\r\n                        console.log('progress: ' + progressPercentage + '% ' + evt.config.file.name);\r\n                    }).success(function (data, status, headers, config) {\r\n                        console.log('file ' + config.file.name + 'uploaded. Response: ' + data);\r\n                    }).error(function (data, status, headers, config) {\r\n                        console.log('error status: ' + status);\r\n                    })\r\n\r\n            }\r\n        };\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"}}