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

Popular posts from this blog

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

matlab - error with cyclic autocorrelation function -

php - Using grpc in Laravel, "Class 'Grpc\ChannelCredentials' not found." -