How to eliminate multiple content disposition?

Code like the following:

run some queries

<cfsavecontent  
	variable = "content">  	

	<html xmlns:o="urn:schemas-microsoft-com:office:office"
		  xmlns:w="urn:schemas-microsoft-com:office:excel" 
		  xmlns="http://www.w3.org/TR/REC-html40"> 
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	...
	<body>
	
	output query results here
	...
	
	</body>
	</html>

</cfsavecontent>
<!--- Excel version --->
<cfheader name="content-disposition" value="filename=Report-#dateformat(now(),'mm-dd-yyyy')#.xls">
<cfcontent type="application/msexcel">
<cfoutput>#content#</cfoutput>

Error msg see subject.

Additional notes:
Error occurs with Chrome browser outputting data to an Excel file but it works fine with Firefox.
How can we eliminate this multiple content disposition thing?

Thanks in advance.

Never mind, I’ve fixed it.

What was the fix?

A long and dynamic file name for the generated Word doc containing comma(s) and/or special character such as & bombed out on Chrome browser.

1 Like