Link to home
Start Free TrialLog in
Avatar of pserranor
pserranor

asked on

Save a Excel file with

I want to download a Excel file, but the browser open the file and not show the dialog "SaveAs..."
I trying with the execCommand and IFRAMES but not work with "xls" files!
     
     

<iframe id="SaveFrame" SRC="MyFile.xls" style="display:show"></iframe>

<html>
<INPUT TYPE="button" STYLE="width: 9em" VALUE="HTML Mode" ONCLICK="SaveFrame.document.('SaveAs',false,'ww.xls')">

</html>
Avatar of tpatten
tpatten

This is because Microsoft IE automatically detects the file as an Excel mime type. Microsoft has tightly integrated IE and Office products. There's no way around it.
If a user who tries to download the file has installed Microsoft Excel then it will load Excel. If the user has not installed Excel, it will start the download normally.
Can you use ASP? If so you can solve this server-side. If so, let me know.

Otherwise I'd probably .zip the file to force someone to download it.
Avatar of pserranor

ASKER

whammy
I can use ASP, how I do it?
ASKER CERTIFIED SOLUTION
Avatar of whammy
whammy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks the example works!!
You're welcome. :)