Skip to main content
Inspiring
February 25, 2009
Question

Custom 'Save As' file name for cfdocument

  • February 25, 2009
  • 3 replies
  • 1846 views
I have a page that generates a PDF (genPDF.cfm). When the user attempts to save it, it saves as genPDF.pdf. Is there any way that when they go to save it, I can dynamically name the document? I am using Blue Dragon 7 here so any cool CF8 additional tags are not accessible. I know, sucks, right? Thanks!
This topic has been closed for replies.

3 replies

Inspiring
February 27, 2009
no clue about BD, but in CF you would use a combination of <cfheader>
and <cfcontent> tags to tell the web server how to serve the file, what
mime type it is, what its name is and where to get the real file from.

all details are in the cfml reference/livedocs. no clue if BD has such
tags, but i would be surprised if it didn't...

<cfheader name="Content-Type" value="application/pdf">
<cfheader name="Content-Disposition" value="attachment;
filename=My_Super_Wicked_PDF.pdf">
<cfcontent type="application/pdf"
file="D:\MyFiles\Docs\PDF\This_PDF_is_actually_lame.pdf" deletefile="No">

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/
wkolczAuthor
Inspiring
February 25, 2009
The file name is genPDF, the files saves as genPDF.pdf.
Inspiring
February 25, 2009
How do you get the name genPDF.cfm and why does it not have a pdf file extension?