I am trying to make a video upload using angular and spring boot. I am using ng-file-upload in angular and in the controller I am using the following method to upload the file
Upload.upload({
url: 'api/uploadFile',
data: {file: file, 'username': $scope.username}
})
On the server I have declared my resource like this
@RestController
@RequestMapping("/api")
public class FileUploadResource {
@ResponseStatus(HttpStatus.OK)
@PostMapping("/uploadFile")
public void uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("username") String name)
When I try uploading the file I keep receiving a 500 error and I can't figure out how to solve it. If you could help me or if you could suggest another method that would be great
Thanks.