Skip to main content
Inspiring
March 12, 2009
Answered

Safari Issue

  • March 12, 2009
  • 1 reply
  • 475 views
The thing is I have to create an excel sheet and make the file available for clients as download. The code for that is --

The code is working perfectly in firefox, ie and chrome. But in safari the file is downloaded with the name of the page in which i have written the code and not the file name that i have specified. Is there anything I am missing? Please HELP!!!
    This topic has been closed for replies.
    Correct answer balumohan
    Hi..
    I got a solution. I gave like
    <!---now open file--->
    <cfset fullpath = #ExpandPath("individualExcelReport")#&"\"&"trialexport.xls">
    <cfheader name="content-disposition" value="attachment;filename=""trialexport.xls""">
    <cfheader name="Content-Description" value="This is a tab-delimited file.">


    <cfcontent type="application/msexcel; charset=utf-8" reset="true" file="#fullpath#" deletefile="true">

    That is in cfheader, I put a double quotes for the filename-- filename=""trialexport.xls""

    1 reply

    Participating Frequently
    March 16, 2009
    The good news is that this isn't a CF problem (though you likely guessed that). A similar problem was reported a few months ago here

    http://www.sitepoint.com/forums/showthread.php?t=582107

    with the language in question being PHP. So, it looks like a bug in Safari. I've been digging around but not been able to find a solution myself. :-(
    balumohanAuthorCorrect answer
    Inspiring
    March 19, 2009
    Hi..
    I got a solution. I gave like
    <!---now open file--->
    <cfset fullpath = #ExpandPath("individualExcelReport")#&"\"&"trialexport.xls">
    <cfheader name="content-disposition" value="attachment;filename=""trialexport.xls""">
    <cfheader name="Content-Description" value="This is a tab-delimited file.">


    <cfcontent type="application/msexcel; charset=utf-8" reset="true" file="#fullpath#" deletefile="true">

    That is in cfheader, I put a double quotes for the filename-- filename=""trialexport.xls""