?
Solved

CfContent types for excel

Posted on 2002-03-28
16
Medium Priority
?
650 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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 
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 200 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

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

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

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

771 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