Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/simple/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ angular

.controller('AppController', ['$scope', 'FileUploader', function($scope, FileUploader) {
var uploader = $scope.uploader = new FileUploader({
url: 'upload.php'
url: 'upload.php',
xhrTimeout: 30000
});

// FILTERS
Expand Down
20 changes: 11 additions & 9 deletions src/services/FileUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ let {


export default function __identity(fileUploaderOptions, $rootScope, $http, $window, $timeout, FileLikeObject, FileItem) {


let {
File,
FormData
} = $window;


class FileUploader {
/**********************
* PUBLIC
Expand All @@ -36,7 +36,7 @@ export default function __identity(fileUploaderOptions, $rootScope, $http, $wind
*/
constructor(options) {
var settings = copy(fileUploaderOptions);

extend(this, settings, options, {
isUploading: false,
_nextIndex: 0,
Expand Down Expand Up @@ -493,6 +493,8 @@ export default function __identity(fileUploaderOptions, $rootScope, $http, $wind

xhr.withCredentials = item.withCredentials;

xhr.timeout = this.xhrTimeout;

forEach(item.headers, (value, name) => {
xhr.setRequestHeader(name, value);
});
Expand Down Expand Up @@ -745,15 +747,15 @@ export default function __identity(fileUploaderOptions, $rootScope, $http, $wind
*/
FileUploader.isHTML5 = FileUploader.prototype.isHTML5;


return FileUploader;
}


__identity.$inject = [
'fileUploaderOptions',
'$rootScope',
'$http',
'fileUploaderOptions',
'$rootScope',
'$http',
'$window',
'$timeout',
'FileLikeObject',
Expand Down