Skip to content

Commit 82af1a8

Browse files
committed
Define bucket after region
1 parent 49cb6c9 commit 82af1a8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

js/controllers.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ controllers.controller('UploadController',['$scope', function($scope) {
88
$scope.creds = {};
99

1010
$scope.upload = function() {
11-
var bucket = new AWS.S3({ params: { Bucket: $scope.creds.bucket } });
1211
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+
1515
if($scope.file) {
1616
// Perform File Size Check First
1717
var fileSize = Math.round(parseInt($scope.file.size));
@@ -34,13 +34,13 @@ controllers.controller('UploadController',['$scope', function($scope) {
3434
toastr.success('File Uploaded Successfully', 'Done');
3535

3636
// Reset The Progress Bar
37-
setTimeout(function() {
37+
setTimeout(function() {
3838
$scope.uploadProgress = 0;
3939
$scope.$digest();
4040
}, 4000);
4141
}
4242
})
43-
.on('httpUploadProgress',function(progress) {
43+
.on('httpUploadProgress',function(progress) {
4444
$scope.uploadProgress = Math.round(progress.loaded / progress.total * 100);
4545
$scope.$digest();
4646
});
@@ -66,4 +66,4 @@ controllers.controller('UploadController',['$scope', function($scope) {
6666
return text;
6767
}
6868

69-
}]);
69+
}]);

0 commit comments

Comments
 (0)