Solved

CfContent types for excel

Posted on 2002-03-28
16
610 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
  • 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
 
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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

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…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now