Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Custom 'Save As' file name for cfdocument

Contributor ,
Feb 25, 2009 Feb 25, 2009
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!
TOPICS
Advanced techniques
1.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 25, 2009 Feb 25, 2009
How do you get the name genPDF.cfm and why does it not have a pdf file extension?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 25, 2009 Feb 25, 2009
The file name is genPDF, the files saves as genPDF.pdf.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2009 Feb 27, 2009
LATEST
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/
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources