-1

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

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Kishh
  • 2,005
  • 4
  • 19
  • 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
  • 74,572
  • 17
  • 113
  • 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
  • 11,875
  • 18
  • 85
  • 108
Andrzej Doyle
  • 102,507
  • 33
  • 189
  • 228