path - how to resolve a fakepath with google chrome using angular2 -
i need path application angular2 typescript path (c:\fakepath\img.png ) ask if there solution thanks
below example:
ts file
upload(file) { console.log('file'+':'+file.value) const inputnode = file.value.replace("c:\\fakepath\\", ""); console.log(inputnode); }
in above function, passed file value parameter , used javascript replace function replace "c:\fakepath\" blank space.
html file
<input class="file" (click)="file.click()" type="file" accept="image/*" #file > <button mat-raised-button (click)="upload(file)">upload</button>
Comments
Post a Comment