Get the file path from an input


Is there a way to get the file path of a file when I use a <input type='file/>? I tried using the .val() property but my output is: C:\fakepath\
How can I work around this??



Electron adds a path property to File objects, so you can get the real path from the input element using:



Hi @enlight I am new to Atom scripting, how do one implement this?

I have around 100 files, I want to add the file path to the document in one go, can this be achieved?



Are you asking about Atom, or Electron? Because if you’re asking about Atom, that’s a different question than the original purpose of this thread and you should start a new one. You also need to explain a bit more about what you want to see.


Apologise @DamnedScholar,

I have created a new topic