One of the issues I am currently facing involves an HTML input and its corresponding component which is responsible for holding a file as a field:
Here is the HTML code snippet:
<input id="templateUpload" type="file" (change)="detectFiles($event)" class="upload-input">
And here is the Component code snippet:
export class RfqTemplateManagerComponent {
selectedFiles: FileList;
currentUpload: File;
constructor(){
}
detectFiles(event) {
this.selectedFiles = event.target.files;
}
uploadTemplate() {
const file = this.selectedFiles.item(0);
this.currentUpload = file;
}
}
I am wondering if there is a way for me to utilize my 'currentUpload' field and inject it into a service that can validate and manipulate the file without needing to upload it again. Is this feasible?