Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 593
  • Last Modified:

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>
0
pserranor
Asked:
pserranor
1 Solution
 
tpattenCommented:
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.
0
 
spiritwithinCommented:
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.
0
 
whammyCommented:
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.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
pserranorAuthor Commented:
whammy
I can use ASP, how I do it?
0
 
whammyCommented:
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20124498.html

Check out the accepted answer, it has an example link.

Also, I used this sample code with VERY little modification and it works just fine for me:

http://www.asp101.com/articles/jason/filedownloadlist/default.asp

Hope this helps!
0
 
pserranorAuthor Commented:
Thanks the example works!!
0
 
whammyCommented:
You're welcome. :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now