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
import{Component}from"@angular/core";import{UploaderService}from"./uploader.service";import{global}from"../global";import{md5}from"./md5";
@Component({selector: "app-uploader",templateUrl: "./uploader.component.html",providers: [UploaderService]})exportclassUploaderComponent{message: string="Please upload an .arff file!";constructor(privateuploaderService: UploaderService){}userID: string=null;onPicked(input: HTMLInputElement){constfile=input.files[0];if(file){constfileMD5=md5(file);console.log("File MD5"+fileMD5);letfileExtension=file.name.split(".").pop();// console.log(fileExtension);if(fileExtension!="arff"&&fileExtension!="ARFF"){this.message="File error! Please provide a valid arff file!";console.error("File extension error!");}else{this.uploaderService.upload(file).subscribe(msg=>{input.value=null;this.message=msg;this.userID=global.userID;});}}}}
UploaderComponent.html:12 ERROR TypeError: string.replace is not a function
at Utf8Encode (md5.ts:102)
at md5 (md5.ts:144)
at UploaderComponent.onPicked (uploader.component.ts:18)
at Object.eval [as handleEvent] (UploaderComponent.html:17)
at handleEvent (core.js:34789)
at callWithDebugContext (core.js:36407)
at Object.debugHandleEvent [as handleEvent] (core.js:36043)
at dispatchEvent (core.js:22533)
at core.js:33721
at HTMLInputElement.<anonymous> (platform-browser.js:1789)
The text was updated successfully, but these errors were encountered:
Environment
OS
elementary OS 5.0 Juno
Angular
Browser
Chrome
Version 77.0.3865.120 (Official Build) (64-bit)
html template
controller ts
The text was updated successfully, but these errors were encountered: