Solved

Exporting to Excel - security warning

Posted on 2012-04-03
1
667 Views
Last Modified: 2012-08-14
I am using the method below to export the contents of a cold fusion page to excel. When I try to open the file my browser gives me the following message (below also). Is there a way to avoid having this message displayed? Thanks.

Message
The file you are trying to open, 'filename.xls', is in a different format than specified by the file extension. Verify that the file is not corruupted and is from a trusted source before opening the file. Do you want to open the file now?

Method
<CFHEADER NAME="Content-Disposition" VALUE="attachment;filename=filename.xls">
<cfcontent type="application/vnd.ms-excel">
0
Comment
Question by:earwig75
[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
1 Comment
 
LVL 52

Accepted Solution

by:
_agx_ earned 500 total points
ID: 37801875
Is there a way to avoid having this message displayed?

No. It's a new ms office security feature called extension hardening. Whenever you open a file and the content doesn't match the file extension you'll get the warning.  In your case it's because the content is actually HTML, but the headers are saying it's an .xls file.

Individual users can disable the setting on their own computers.  But because it's a security feature, you can't do anything about it from the server.  The only way to avoid the warning is

See When you open a file in Excel 2007, you receive a warning that the file format differs from the format that the file name extension specifies

     1) generate a real excel file (like with cfspreadsheet)
      or
     2) ensure sure the content and file extension match, like generating *.csv file instead
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

PROBLEM:  How to open a cfwindow or run a function on double click of a cfgrid row. One of my clients wanted to be able to double click on a row item to get more detailed information about a transaction and to be able to modify the line items i…
PROBLEM: How to add your own buttons to the bottom toolbar with paging info ( result count ). While creating a cfgrid, I ran into an issue where I wanted to embed my own custom buttons where the default ones ( insert / delete / etc… ) are for aes…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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