0

A block of Html template looks something like this,

<div class="field" style="padding:1%">
            <label>Ledger Sample Copies</label>
        <input type="file" formControlName="savingsfile" [(ngModel)]="category.filepath" (change)= "FilePathHandler($event)" >

    </div>

and my respective component method looks like this,

FilePathHandler(fileName) {

  console.log("Files :",fileName.target.value);
  console.log("Files :",this.category.filepath);
}

I am trying to print and insert the path of any document selected from the file input into a database table.

But i am not able to display the filepath in the console.log.

The example output i got for the console logs are below,

Files : C:\fakepath\linux_java_eclipse.txt Files : undefined

I want to display the actual path of the file not with any fakepath.

could someone please help me out ?

I am working on ubuntu 7.14 machine if that helps out.

georgeawg
  • 46,994
  • 13
  • 63
  • 85
Chandra Mouli
  • 19
  • 2
  • 5

1 Answers1

0

I want to display the actual path of the file not with any fakepath.

For security reasons the actual path of selected document is not provided to websites. Only filename and a fake path is provided.

If interested in knowing more, please go through this thread.

How to resolve the C:\fakepath?

Ravinder Payal
  • 2,459
  • 21
  • 38