HTML question if anyone knows - Chicagoland Sportbikes
Chicagoland Sportbikes
 
Open Forum This forum is for all off-topic discussion.

 
LinkBack Thread Tools Display Modes
post #1 of 5 (permalink) Old 11-21-2005, 02:59 PM Thread Starter
I break everything!
 
JonGu's Avatar
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 1,913
Location: Chicago, IL
Sportbike: SV650S, ZX6R, GSXR600
Years Riding: Since 04/2003
How you found us: Google
           
HTML question if anyone knows

I can't seem to figure this out...

I have this webpage that generates Excel reports, so after it generates the report, it presents the user with a link to the report. Whenever the user clicks on the link, it opens it as garbled text in the browser instead of opening it in excel. Even when I right-click save, the file type defaults to 'htm file' instead of 'xls file'

It only happens with Internet Explorer, and when I try to open Excel spreadsheets off the internet it does it correctly. I even tried copying the report file to my own personal web host and made a link to it and it works perfectly. Just that when it tries to pull it off our server here, it still thinks its an HTM file. And I tried adding the MIME type to the link like < a href="report.xls" type="application/msexcel" > but no luck.

The web server is Tomcat 5.5.

Post up if anyone has clues. Thanks!

Jon Gu
CCS AM/NESBA #276
JonGu is offline  
Sponsored Links
Advertisement
 
post #2 of 5 (permalink) Old 11-21-2005, 03:12 PM
SV650N
 
crashomon's Avatar
 
Join Date: Jul 2005
Location: Over by Toyota Park
Posts: 3,117
Location: Over by Toyota Park
Sportbike: 2005 SV650SN
Years Riding: Since 1980
How you found us: craigslist
           
Hi, you may need to configure tomcat to recognize the file type in order to serve it up properly. If its anything like apache, you simply add another mime type to make it work.

Not sure if this is your issue, but thats what I would check.
crashomon is offline  
post #3 of 5 (permalink) Old 11-21-2005, 03:18 PM Thread Starter
I break everything!
 
JonGu's Avatar
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 1,913
Location: Chicago, IL
Sportbike: SV650S, ZX6R, GSXR600
Years Riding: Since 04/2003
How you found us: Google
           
I just thought to check that, it has "application/msexcel" mapped to .xls files, and just for shits and grins I removed the mapping and readded it and restarted the server, still no dice.

Jon Gu
CCS AM/NESBA #276
JonGu is offline  
post #4 of 5 (permalink) Old 11-21-2005, 08:56 PM
 
Join Date: Jun 2005
Posts: 2,022
           
In my ASP files, if I want to do something like this, I have to set the content type to excel so it specifically opens in excel. Not sure what script/lang you are using but you want to look for something that sets the content type specifically to excel for that particular script/lang. In your example you had something like that for the link..perhaps it needs to be at the page level which is what I have.

Response.ContentType = "application/vnd.ms-excel"

Perhaps just try switching this content type into your link and see if that works.
cam_neely_8 is offline  
post #5 of 5 (permalink) Old 11-21-2005, 09:30 PM Thread Starter
I break everything!
 
JonGu's Avatar
 
Join Date: Aug 2004
Location: Chicago, IL
Posts: 1,913
Location: Chicago, IL
Sportbike: SV650S, ZX6R, GSXR600
Years Riding: Since 04/2003
How you found us: Google
           
Looks like the problem was the Tomcat just didn't want to serve up Excel files from the root directory. I made another folder and dumped the Excel files there and now they open up fine. Weird

Jon Gu
CCS AM/NESBA #276
JonGu is offline  
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the Chicagoland Sportbikes forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome