You can upload a file using the ngFileUpload or angularFileUpload directives.
In the case of angularFileUpload you use .upload in the controller, and in the case of ngFileUpload you use .http
Alternatively, you can also use the content type application / x-www-form-urlencoded instead of multipart if your file is small. In the case of the / x -www-form-urlencoded application, you can simply get the value in the rest web service as a normal InputStream, thereby not requiring sorting of multi-page data.
You can refer below to possible ways to upload a file using angular js and the web rest service:
http://technoguider.com/2015/08/file-upload-using-angular-js-and-rest-web-service/
source share