Solved

CfContent types for excel

Posted on 2002-03-28
16
646 Views
Last Modified: 2013-12-24
I am having difficulty with CFContent opening into Excel. On my computer it works fine, on others Excel will open but no data is populated and/or it can't resolve the form parameters I'm sending to it. Does this have to do with setting up mime types? Is there a standard configuration I can set so this will work across all computers.

Here's the line of code I am using:

<CFCONTENT type="application/vnd.ms-excel">

Thanks!
0
Comment
Question by:kari208
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
16 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903345
try one of these"
   application/vnd.ms-excel  
   application/x-msexcel  
   application/ms-excel
   application/msexcel
   application/x-excel
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903347
actually.. now re-reading the question... the issue might be the mime types setup for the browser.. which browser is it?

CJ
0
 

Author Comment

by:kari208
ID: 6903350
IE 5.5
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
LVL 19

Expert Comment

by:cheekycj
ID: 6903354
ok try this:
<CFHEADER NAME="content-disposition" VALUE="attachment; filename=whatever.xls">
     <!--- Do all your queries.. form processing etc  --->
     <!--- Set the content type of the file. --->
     <CFCONTENT TYPE="text/tabdelimited">

<!--- output formatted data in a table --->
0
 

Author Comment

by:kari208
ID: 6903357
IE 5.5
0
 

Author Comment

by:kari208
ID: 6903392
That seemed to do the trick EXCEPT that now I'm prompted as to whether I want to save or open. Not a horrible thing, but any way I can get around that??

Thanks so much!
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903397
you have to add "text/tabdelimited" as a mime type that is opened by MS Excel..

CJ
0
 

Author Comment

by:kari208
ID: 6903413
That seemed to do the trick EXCEPT that now I'm prompted as to whether I want to save or open. Not a horrible thing, but any way I can get around that??

Thanks so much!
0
 

Author Comment

by:kari208
ID: 6903415
I'm sure I should know how to do that, but I don't...:)
0
 

Author Comment

by:kari208
ID: 6903417
I'm sure I should know how to do that, but I don't...:)
0
 

Author Comment

by:kari208
ID: 6903421
I'm sure I should know how to do that, but I don't...:)
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903456
Now This might work without changing any mime types:
<CFHEADER NAME="content-disposition" VALUE="attachment; filename=whatever.xls">
    <!--- Do all your queries.. form processing etc  --->
    <!--- Set the content type of the file. --->
    <CFCONTENT TYPE="application/vnd.ms-excel">

<!--- output formatted data in a table --->

To change/add mime type.
Launch Microsoft Explorer (not Internet Explorer).
From the View menu, choose Options or from the Tools menu, choose Folder Options.
Select the File Types tab.
Click "New"
Add extension "xlc" // you may have to change the extension since xls is taken.
select MS-Excel as the app to open it with.

Also make sure that in the above "File Types" tab.. for file type xls it has open in window selected (should be under Advanced button)

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903461
Please don't hit reload.. it posts the last comment again.. and sends me another email :-)

There is a link on the top of this page.. on the right.. "Reload Question"  Click that to check for updates.

CJ
0
 

Author Comment

by:kari208
ID: 6903490
Sorry about the reload...I noticed that a bit late. :)

This code got me down to one prompt versus two:
<CFHEADER NAME="content-disposition" VALUE="attachment; filename=whatever.xls">
   <!--- Do all your queries.. form processing etc  --->
   <!--- Set the content type of the file. --->
   <CFCONTENT TYPE="application/vnd.ms-excel">

To change the mime type, is there a way this can be done on the server so that I don't require all of my clients to have to change their mime types? If not, perhaps I'm just better off dealing with the prompt.
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 50 total points
ID: 6903533
Not really.. the mime-type.. is set on client's browser or PC.. you really can't control that or change that (too big of security risk).. all you can do is give steps on how to configure it to make it convenient.

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6903646
Glad I could help.  Thanx for the "A"
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
PHP Register global 21 117
IIS 404 Error on website Automatic Redirect to /help 5 72
UPLOAD FILE TO Web API USING POST 5 134
HTTPS for signup & login - HTTP for all other pages 10 82
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question