If the Excel file is saved to disk, then use something like:

        <CFHEADER
                NAME="content-disposition"
                VALUE="attachment; filename=filename.xls">

        <CFCONTENT
                TYPE="application/vnd.ms-excel"
                FILE="c:\where\ever\file.xls"
                DELETEFILE="No">

If the Excel file is saved as a CF variable, the use something like:

        <CFHEADER
                NAME="content-disposition"
                VALUE="attachment; filename=filename.xls">

        <CFCONTENT
                TYPE="application/vnd.ms-excel">

        <CFOUTPUT>#ExcelContents#</CFOUTPUT>

Note that in both cases, the value of the VALUE attribute of the CFHEADER
tag is:

        "attachment; filename=filename.xls"

Don't add any extra quotes in there.

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 942-5378
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


> -----Original Message-----
> From: John Stanley [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 18, 2003 8:41 AM
> To: CF-Talk
> Subject: RE: CFFile Pointers
>
>
> I am working on this now, any tips?
>
> -----Original Message-----
> From: Randell B Adkins [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 18, 2003 7:08 AM
> To: CF-Talk
> Subject: RE: CFFile Pointers
>
>
> Or when the user clicks on the name of the file, use CFCONTENT
> to push the file to them as a download.
>
>
>
> >>> [EMAIL PROTECTED] 03/17/03 05:19PM >>>
> CFFile would be used to write out the xls file on the server, on a
> shared
> drive, upload a file, etc.
>
> To save the xls file to their desktop (or wherever) they should simply
> choose 'save as' from the file menu once the spreadsheet is loaded or
> right-click the link and choose 'save target as'
>
> In short, you don't need cffile for this.
>
>
> --  Ben Doom
>     Programmer & General Lackey
>     Moonbow Software, Inc
>
> : -----Original Message-----
> : From: John Stanley [mailto:[EMAIL PROTECTED]
> : Sent: Monday, March 17, 2003 4:51 PM
> : To: CF-Talk
> : Subject: CFFile Pointers
> :
> :
> : Good afternoon all,
> :   I have been tasked with the following:
> :
> : 1. The user can run a report based upon some selection criteria
> (fields,
> : ect).
> : 2. The user can see this report in two different formats (a. on the
> site
> : itself rendered in HTML, and b. in excel spreadsheet format -- I have
> used
> : the custom tag cf_excel for the latter)
> :
> : This all works fine.
> :
> : Except for the following:
> :
> : Sometimes the spreadsheet opens inside the parent web page, and
> : sometimes it
> : opens in excel. But either way, it is still a spreadsheet.
> :
> : It seems to be desktop specific, it will either always load inside
> the
> : browser, or inside an instance of Excel. I
> :
> : So instead the users want the ability to save the spreadsheet instead
> of
> : actually seeing it run.
> :
> : I am having a hard time understanding how to make this work.
> :
> : This is what I think should happen:
> :
> : 1. User clicks the To Excel button
> : 2. Page executes (Query is run, recordset is generated, custom tag
> is
> : called, spreadsheet is built)
> : 3. User is promted to save the resulting .xls file (using CFFile?).
> : 4. User saves the file using standard windows file selection
> interface.
> :
> : I am sure this is possible, but cant seem to get to step 3 from step
> 2.
> :
> : Any help would be appreciated.
> :
> : John
> :
> :
> :
>
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to