Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel documents open in browser as binary code

Status
Not open for further replies.

botatun

Programmer
Mar 7, 2006
40
US
Hi,
I try to open xls and csv files by javascript statement:
window.location.href="myExcelDoc.xls";
It is open file in IE as a binary code.
I check Tomcat web.xml and added
<mime-mapping>
<extension>xls</extension>
<mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping>
<mime-mapping>
<extension>csv</extension>
<mime-type>application/vnd.ms-excel</mime-type>
</mime-mapping>

Now <a href="myExcelDoc.xls">Excel Doc</a> opens fine - asked to open or save etc.
But javascript still opened as binary code in browser.
How to fix it?

Thank you.

Vadim.




 
You could start by letting us have a look at the javascript code you're using to try to open the file. Programming is our strong point, but most of us didn't pay attention in telepathy class :)

Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.

Enable Apps
 
The code is simple:

function runURL(url)
{
window.location.href=url;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top