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
Solved

CfContent types for excel

Posted on 2002-03-28
16
637 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
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.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
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…

861 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