-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/danialfarid/angular-file-…
- Loading branch information
Showing
1 changed file
with
7 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ var MyCtrl = [ '$scope', '$http', function($scope, $http) { | |
for (var i = 0; i < $files.length; i++) { | ||
var $file = $files[i]; | ||
$http.uploadFile({ | ||
url: 'my/upload/url', | ||
url: 'server/upload/url', //upload.php script, node.js route, or servlet uplaod url) | ||
data: {myObj: $scope.myModelObj}, | ||
file: $file | ||
}).then(function(data, status, headers, config) { | ||
|
@@ -41,9 +41,9 @@ var MyCtrl = [ '$scope', '$http', function($scope, $http) { | |
``` | ||
|
||
|
||
You also need **FileAPI.min.js** and **FileAPI.flash.swf** files. They will be loaded on demand for the browsers that do not support HTML5 FormData but have support for Flash (For example IE9+) | ||
So they are just there for as polyfill for HTML5 and they will be ignored and not loaded if your browser already supports FormData. | ||
**Note**: IE8 is not supported by FileAPI. | ||
You also need **FileAPI.min.js** and **FileAPI.flash.swf** files as polyfill using Flash for browsers that does not support HTML5 FormData (i.e. IE9+). | ||
For HTML5 FromData supported browsers they will be ignored (not loaded). | ||
**Note**: IE8 is not supported since FileAPI doesn't support it. The good news is that google and github have dropped IE8 support too. | ||
|
||
The js file **FileAPI.min.js** must be placed beside angular-file-upload.js. If the swf file **FileAPI.flash.swf** is placed in another directory on the server do the following step, unless they will be automatically loaded from the same location as angular-file-upload.js. | ||
```script | ||
|
@@ -60,7 +60,7 @@ If JQuery is not included in your page then it will be loaded from google CDN fo | |
|
||
You can find the sample server code in Java/GAE [here](https://github.com/danialfarid/angular-file-upload/blob/master/src/com/df/angularfileupload/FileUpload.java). | ||
|
||
If you wish to use CDN to include the script files you can use this CDN: [http//cdn.jsdelivr.net/angular.file-upload/0.1.1/angular-file-upload.js](//cdn.jsdelivr.net/angular.file-upload/0.1.1/angular-file-upload.js) | ||
If you wish to use CDN to include the script files you can use this CDN: [http//cdn.jsdelivr.net/angular.file-upload/0.1.4/angular-file-upload.js](//cdn.jsdelivr.net/angular.file-upload/0.1.1/angular-file-upload.js) | ||
If you use this CDN you need to add a crossdomain.xml file to your root server in order for the Adbobe Flash to be able to upload the file for IE. | ||
|
||
crossdomain.xml (Only needed if you are using CDN instead of having the js/swf files on your server) | ||
|
@@ -71,6 +71,8 @@ crossdomain.xml (Only needed if you are using CDN instead of having the js/swf f | |
</cross-domain-policy> | ||
``` | ||
|
||
If you use this module you can give it a thumbs up at [http://ngmodules.org/modules/angular-file-upload](http://ngmodules.org/modules/angular-file-upload). | ||
|
||
Let [me](mailto:[email protected]) know if you see any bug or open an [issue](https://github.com/danialfarid/angular-file-upload/issues). | ||
|
||
|
||
|