Solved

Exporting to Excel - security warning

Posted on 2012-04-03
1
664 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

772 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