@@ -8,10 +8,10 @@ controllers.controller('UploadController',['$scope', function($scope) {
8
8
$scope . creds = { } ;
9
9
10
10
$scope . upload = function ( ) {
11
- var bucket = new AWS . S3 ( { params : { Bucket : $scope . creds . bucket } } ) ;
12
11
AWS . config . update ( { accessKeyId : $scope . creds . access_key , secretAccessKey : $scope . creds . secret_key } ) ;
13
- AWS . config . region = 'us-east-1' ;
14
-
12
+ AWS . config . region = 'us-east-1' ;
13
+ var bucket = new AWS . S3 ( { params : { Bucket : $scope . creds . bucket } } ) ;
14
+
15
15
if ( $scope . file ) {
16
16
// Perform File Size Check First
17
17
var fileSize = Math . round ( parseInt ( $scope . file . size ) ) ;
@@ -34,13 +34,13 @@ controllers.controller('UploadController',['$scope', function($scope) {
34
34
toastr . success ( 'File Uploaded Successfully' , 'Done' ) ;
35
35
36
36
// Reset The Progress Bar
37
- setTimeout ( function ( ) {
37
+ setTimeout ( function ( ) {
38
38
$scope . uploadProgress = 0 ;
39
39
$scope . $digest ( ) ;
40
40
} , 4000 ) ;
41
41
}
42
42
} )
43
- . on ( 'httpUploadProgress' , function ( progress ) {
43
+ . on ( 'httpUploadProgress' , function ( progress ) {
44
44
$scope . uploadProgress = Math . round ( progress . loaded / progress . total * 100 ) ;
45
45
$scope . $digest ( ) ;
46
46
} ) ;
@@ -66,4 +66,4 @@ controllers.controller('UploadController',['$scope', function($scope) {
66
66
return text ;
67
67
}
68
68
69
- } ] ) ;
69
+ } ] ) ;
0 commit comments