• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFCONTENT Problem

Community Beginner ,
Jun 14, 2006 Jun 14, 2006

Copy link to clipboard

Copied

I am using CFCONTENT to display an Excel file after a person clicks on the row in CFGRID. The code below is the code I am using:

<cfset filePath = "d:\Inetpub\OpptyAttachments\#getReport.oppID#\#trim(getReport.attachName)#">
<cfset apptype = #Right(getReport.attachName, 3)#>

<CFHEADER NAME="content-disposition" VALUE="inline; filename=#Trim(getReport.attachName)#">
<cfif (apptype IS 'xls') or (apptype IS 'csv')>
<cfcontent type="application/vnd.ms-excel" file="#Trim(filePath)#" deletefile="No">
</cfif>

When I try to open the Excel file I get the following error in IE:
Action canceled
Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable.

If I refresh the browser the file dialoge box opens up.

This error is just for Excel files, I am not having this problem with text, pdf or images.

Any suggestions would be helpful!
TOPICS
Advanced techniques

Views

365

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jun 15, 2006 Jun 15, 2006
Thanks for the help. I got the code working!

Votes

Translate

Translate
Community Expert ,
Jun 15, 2006 Jun 15, 2006

Copy link to clipboard

Copied

Test with the code below. In place of xxx put the actual value of getReport.attachName and, in place of yyy, put the actual full path to the file.

<cfheader name="Content-Disposition" value="inline; filename=xxx">
<cfcontent type="application/vnd.ms-excel" file="yyy">

If it works, then that will tell you there is an error in the evaluation of the variables.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 15, 2006 Jun 15, 2006

Copy link to clipboard

Copied

LATEST
Thanks for the help. I got the code working!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation