-1

How can I get an "open file dialogue" box in JavaScript?

Bhargav Rao
  • 45,811
  • 27
  • 120
  • 136
Kishh
  • 1,847
  • 4
  • 18
  • 16

2 Answers2

3

Javascript cannot open files. (Leastways not in any cross browser secure way).

Possibly you'd be interested in <input type="file" /> (an intro here).

annakata
  • 72,622
  • 16
  • 112
  • 180
0

Short answer is that no, you cannot do this through pure Javascript; the only way to do this is via an HTML form with an <input type="file"> element.

peterh
  • 1
  • 15
  • 76
  • 99
Andrzej Doyle
  • 100,133
  • 33
  • 186
  • 226