Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- percentageArray = [];
- startUpload(event: FileList) {
- Array.from(event).forEach(file => {
- if (file.type.split('/')[0] != 'image') {
- alert('Dieses Dateiformat wird nicht unterstützt');
- }
- // Storage path
- const path = `uploads/${this.currentUserEmail}/${this.uniqueID}/${file.name}`;
- // Meta Data
- const customMetadata = {
- auctionID: this.uniqueID.toString()
- }
- // Main Task
- this.task = this.storage.upload(path, file, {customMetadata});
- // Progress Monitoring
- this.percentage = this.task.percentageChanges();
- this.percentage.subscribe(p => {
- this.percentageArray.push(p);
- })
- this.snapshot = this.task.snapshotChanges();
- // File Download Url
- this.downloadURL = this.task.downloadURL();
- this.imgArray.push(path);
- })
- }
- <div *ngIf="percentageArray as item" class="w-100">
- <div *ngFor="let elem of item">
- <ngb-progressbar type="info" [value]="elem" [striped]="true" [max]="100" [showValue]="true"></ngb-progressbar>
- </div>
- </div>
Add Comment
Please, Sign In to add comment