-
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.
multiple files for HTML5 browsers #69
- Loading branch information
1 parent
7aaed51
commit 384bc59
Showing
12 changed files
with
33 additions
and
15 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "angularjs-file-upload", | ||
"main": "angular-file-upload.min.js", | ||
"version": "1.1.10", | ||
"version": "1.1.11", | ||
"homepage": "https://github.com/danialfarid/angular-file-upload", | ||
"authors": [ | ||
"Danial Farid <[email protected]>" | ||
|
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/**! | ||
* AngularJS file upload shim for angular XHR HTML5 browsers | ||
* @author Danial <[email protected]> | ||
* @version 1.1.10 | ||
* @version 1.1.11 | ||
*/ | ||
if (window.XMLHttpRequest) { | ||
if (window.FormData) { | ||
|
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/**! | ||
* AngularJS file upload shim for HTML5 FormData | ||
* @author Danial <[email protected]> | ||
* @version 1.1.10 | ||
* @version 1.1.11 | ||
*/ | ||
(function() { | ||
|
||
|
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/**! | ||
* AngularJS file upload/drop directive with http post and progress | ||
* @author Danial <[email protected]> | ||
* @version 1.1.10 | ||
* @version 1.1.11 | ||
*/ | ||
(function() { | ||
|
||
|
@@ -35,7 +35,16 @@ angularFileUpload.service('$upload', ['$http', '$rootScope', '$timeout', functio | |
} | ||
} | ||
config.transformRequest = angular.identity; | ||
formData.append(config.fileFormDataName || 'file', config.file, config.file.name); | ||
|
||
var fileFromName = config.fileFormDataName || 'file'; | ||
|
||
if (Object.prototype.toString.call(config.file) === '[object Array]') { | ||
for (var i = 0; i < config.file.length; i++) { | ||
formData.append(fileFromName + i, config.file[i], config.file[i].name); | ||
} | ||
} else { | ||
formData.append(fileFromName, config.file, config.file.name); | ||
} | ||
|
||
formData['__setXHR_'] = function(xhr) { | ||
config.__XHR = xhr; | ||
|
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/**! | ||
* AngularJS file upload shim for angular XHR HTML5 browsers | ||
* @author Danial <[email protected]> | ||
* @version 1.1.10 | ||
* @version 1.1.11 | ||
*/ | ||
if (window.XMLHttpRequest) { | ||
if (window.FormData) { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/**! | ||
* AngularJS file upload shim for HTML5 FormData | ||
* @author Danial <[email protected]> | ||
* @version 1.1.10 | ||
* @version 1.1.11 | ||
*/ | ||
(function() { | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/**! | ||
* AngularJS file upload/drop directive with http post and progress | ||
* @author Danial <[email protected]> | ||
* @version 1.1.10 | ||
* @version 1.1.11 | ||
*/ | ||
(function() { | ||
|
||
|
@@ -35,7 +35,16 @@ angularFileUpload.service('$upload', ['$http', '$rootScope', '$timeout', functio | |
} | ||
} | ||
config.transformRequest = angular.identity; | ||
formData.append(config.fileFormDataName || 'file', config.file, config.file.name); | ||
|
||
var fileFromName = config.fileFormDataName || 'file'; | ||
|
||
if (Object.prototype.toString.call(config.file) === '[object Array]') { | ||
for (var i = 0; i < config.file.length; i++) { | ||
formData.append(fileFromName + i, config.file[i], config.file[i].name); | ||
} | ||
} else { | ||
formData.append(fileFromName, config.file, config.file.name); | ||
} | ||
|
||
formData['__setXHR_'] = function(xhr) { | ||
config.__XHR = xhr; | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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