Uploadr is an Angular module for uploading files easily. Uploadr has no dependencies (no jQuery).
Uploadr supports Firefox 4+, Chrome 7+, IE 10+, Opera 12+. Check this Can I Use page for more details.
Tested with Angular 1.1.
Download angular-uploadr.js
and include it in your page.
Here's an example using a directive for file input.
If you are using a controller, load uploadr like this:
angular.controller('MyController', function ($scope, uploadr) {
// your code
});
Sets the upload URL.
Returns: uploadr
Clears all fields including files.
Returns: uploadr
Adds a field to the form.
Returns: uploadr
Adds a file or a file array to the form. name is field name and optional, defaults to "files".
Returns: uploadr
Overrides default uploadr $http options.
Returns: uploadr
Starts the upload.
Returns: $http (promise)
"this callback will be called asynchronously when the response is available"
Returns: promise
"called asynchronously if an error occurs or server returns response with an error status."
Returns: promise
- callback: function(data, status, headers, config), all are optional