Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Exporting to Excel - security warning

Posted on 2012-04-03
1
Medium Priority
?
672 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 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

636 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