3 Replies Latest reply on May 16, 2007 5:45 AM by Eric_L_@_P&WC

    Opening CSV file via CFHTTP in Excel 2003

      Hi Guys

      We are having an issue with a CFM page we have created (using CFHTTP) to extract/open a CSV file from a Unix Drive, under Windows XP/Excel 2003.

      Our apps is on our Portal to open a CSV file (Excel Download). When clicking on our Download button, the regular IE pop up let us choose between Opening the file or Save it. On W2K/Excel 2K, both options are behaving properly, meaning that I can locally save the CSV file or opening it in Excel. With Win XP and Excel 2003, the SAVE option is working OK as it let me save my CSV file, but when I'm clicking on OPEN, it will launch Excel and will open my CFM page (lets call it downloadCFHTTP.cfm) in Excel with the content of the CSV file in it. so if you are trying to save that file once displayed in Excel, the program crashed as it looks like it is trying to save the CFM file on the web server instead of proposing the user to save the CSV file.

      Have you ever experienced something like that? How can it be fixed?

      Thanks in advance

      Eric L.
        • 1. Re: Opening CSV file via CFHTTP in Excel 2003
          Try some thing like this

          <a href="file://servername/app/csvfile.lnk">somename</a>

          the lnk file is a shortcutfile from Win XP which does the work
          • 2. Re: Opening CSV file via CFHTTP in Excel 2003
            insuractive Level 3
            Are you giving the CSV file a filename when you serve it to the client? Something like this:

            <CFHEADER NAME="Content-Disposition" VALUE="attachment;filename=myFile.csv">
            <cfcontent type="application/text"><cfoutput>#sFileContent#</cfoutput>

            Note - I'm not exactly sure about the MIME type in the <cfcontent> tag. Might want to double check that.
            • 3. Re: Opening CSV file via CFHTTP in Excel 2003
              Eric_L_@_P&WC Level 1
              Hi guys

              Thanks for the feedback.

              The way it works is that we have an SAP R/3 Web application hosted on our ITS Servers and when this application is executed by a given user (let say its ID is IN00010), it will create a CSV file on a Unix Drive called Forecast_IN00010.CSV and the download button will get that file to open it in Excel or Save it on your HD. That is why the suggestion to use a LNK link would not worked in this specific situation.

              I'll have my Web eBusiness Team taking a look at this suggestion, and I'll let you know!


              Eric L.