Skip to main content
Inspiring
September 22, 2015
Answered

Cfcontent in IE

  • September 22, 2015
  • 1 reply
  • 576 views

Hi all,

This is my code to download an excel file.

<cfspreadsheet action="write" filename="#local.location#\#local.fileName#" query="local.qryResultset" overwrite="false" /> 

<cfheader name="Content-Disposition" value="inline; filename=#local.fileName#;" />

<cfcontent file="#local.location#\#local.fileName#" type="application/msexcel" reset="no" deletefile="yes" />

All my variables are passing fine. The process worked fine in firefox but in IE i have an issue (http or https), it shows an error at the time of saving the file:

LOCALNAME20150922153304.xls might have been moved or deleted.

It looks like IE is caching the name somewhere?

Any ideas?

We are using Coldfusion 10.

Best,

    This topic has been closed for replies.
    Correct answer jfb00

    I changed the word inline for attachment and it works.

    <cfheader name="Content-Disposition" value="inline; filename=#local.fileName#;" />

    For:

    <cfheader name="Content-Disposition" value="attachment; filename=#local.fileName#;" />

    I hope this help someone else.

    Best.

    1 reply

    jfb00Author
    Inspiring
    September 22, 2015

    I deleted all the excel files.

    The first time works and create the excel file the second time it doesn't work and create a file as LOCALACCOUNTNAME20150922165514209.xls.q62hqlo.partial

    If I deleted all the excel files the first time works again. This is crazy

    BTW we are using IE 11.

    Any ideas?

    Thanks in advanced

    jfb00AuthorCorrect answer
    Inspiring
    September 22, 2015

    I changed the word inline for attachment and it works.

    <cfheader name="Content-Disposition" value="inline; filename=#local.fileName#;" />

    For:

    <cfheader name="Content-Disposition" value="attachment; filename=#local.fileName#;" />

    I hope this help someone else.

    Best.