This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Filename: upload.component.ts | |
import { Component, OnInit } from '@angular/core'; | |
import { UploadService } from '../upload.service'; | |
import { map, expand } from 'rxjs/operators'; | |
import { EMPTY } from 'rxjs'; | |
export class uploadFiles { | |
constructor(public video: File, public path: string, public uploadURI: string) { | |
this.video = video; | |
this.path = path; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { map, expand } from 'rxjs/operators'; | |
import { EMPTY } from 'rxjs'; | |
import { CompressorService } from './compressor.service'; | |
@Component({ | |
selector: 'app-root', | |
template: '<input type="file" (change)="process($event)" multiple/>', | |
styles: [''] | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<!-- HTML Part --> | |
<input id="file" type="file" accept="image/*"> | |
<script> | |
document.getElementById("file").addEventListener("change", function (event) { | |
compress(event); | |
}); | |
</script> | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file: FileList; //populated on filechange | |
uploadURI: Array < String >; //populated after filechange | |
public Tus() { | |
if (this.file.length > 0 && this.uploadURI.length > 0) { | |
this.uploadService.tusUpload(this.file, this.uploadURI); | |
} | |
} else { | |
alert('file length error'); | |
} |