0

I want to click on a button to open a window and choose a file. I'm using this code for the choosing:

<button onclick="document.getElementById('file-input').click();">Open</button>
<input id="file-input" type="file" name="name" style="display: none;" />

How can I save the path? (For example c:\temp\song.mp3)

I dont need to download the file. it's a local file.

4
  • As far as I know, you can't. Commented Mar 28, 2017 at 12:28
  • But why would you want to save a file? Commented Mar 28, 2017 at 12:29
  • i want to save the path and after to do somethig with the file. run some function on the file. Commented Mar 28, 2017 at 12:31
  • You can't modify user files with JS. Commented Mar 28, 2017 at 12:33

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.