You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way that we can add multiple files and upload it directly without having an upload button? The requirement is drag/drop and droplet-upload-multiple and after adding the files it should upload automatically. I've tried putting the interface.uploadFiles() inside $dropletFileAdded but it's some sort of a wacky stuff because $dropletFileAdded listener executes as much number as the files are, that means if I upload 2 files, the interface.uploadFiles() will execute twice, first with single file, second with 2 files. The easier approach is if it's possible for us to identify how many files are added or dropped in the first place so we could just use _.size(interface.getFiles()) inside $dropletFileAdded and compare with how many files are added before calling the interface.uploadFiles() stuff. Please have a look at the sample code below
$scope.$on('$dropletFileAdded', function(event, file){ if (file.type & $scope.interface.FILE_TYPES.INVALID) { // Recently added file is invalid... toaster.pop('error', 'Invalid', 'Bad file type added'); } else { if(!$scope.interface.isUploading()) { $scope.interface.uploadFiles(); } } });
The text was updated successfully, but these errors were encountered:
Is there a way that we can add multiple files and upload it directly without having an upload button? The requirement is drag/drop and droplet-upload-multiple and after adding the files it should upload automatically. I've tried putting the interface.uploadFiles() inside $dropletFileAdded but it's some sort of a wacky stuff because $dropletFileAdded listener executes as much number as the files are, that means if I upload 2 files, the interface.uploadFiles() will execute twice, first with single file, second with 2 files. The easier approach is if it's possible for us to identify how many files are added or dropped in the first place so we could just use _.size(interface.getFiles()) inside $dropletFileAdded and compare with how many files are added before calling the interface.uploadFiles() stuff. Please have a look at the sample code below
$scope.$on('$dropletFileAdded', function(event, file){ if (file.type & $scope.interface.FILE_TYPES.INVALID) { // Recently added file is invalid... toaster.pop('error', 'Invalid', 'Bad file type added'); } else { if(!$scope.interface.isUploading()) { $scope.interface.uploadFiles(); } } });
The text was updated successfully, but these errors were encountered: