1

I am using following code to open a file dialog box, but nothing happens on button click(). What's wrong?

<input id="btnBrowse" name="btnBrowse" type="button" value="Browse" onclick="document.execCommand('SaveAs');"/>

Edited:

Any other way to open such a dialog on other browsers as well?

RKh
  • 13,818
  • 46
  • 152
  • 265
  • Related SO post: [Javascript: document.execCommand cross-browser?](http://stackoverflow.com/questions/1817441/javascript-document-execcommand-cross-browser) – o.k.w Dec 30 '09 at 07:41
  • look at this answer http://stackoverflow.com/questions/833015/does-execcommand-saveas-work-in-firefox – Haim Evgi Dec 30 '09 at 07:41

3 Answers3

1

AFAIK, It will work only in IE. It is working on my IE 7 and not in FF.

Check this : http://msdn.microsoft.com/en-us/library/ms536419%28VS.85%29.aspx

Anuraj
  • 18,859
  • 7
  • 53
  • 79
0

IT works in IE only !

Sarfraz
  • 377,238
  • 77
  • 533
  • 578
0

I found an alternative. It's name is Uploadify and is a JQuery implementation.

RKh
  • 13,818
  • 46
  • 152
  • 265