0

I am using <cfpdfform> to populate a LiveCycle Designer developed pdf form. I've excluded the destination attribute and the pdf shows in the browser exactly as I wish. However, it provides a filename of a series of numbers followed by=temp.pdf.

Is there any way to provide a variable name for the displayed file?

For example, if I provide a #URL.name# in my form submission, I would like the filename displayed in the browser to be smith.pdf or whatever name I place in the #URL.name#

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Lawyer_Coder
  • 203
  • 1
  • 3
  • 14

1 Answers1

0

I think this is what you need below. I once had to create a pdf document using cfdocument and I used the below to specify the filename to render as. The caveat is that i had to save the file on the file system first which i achieved with same cfdocument.

note path_to_pdf_file_on_server and name_to_render_as.pdf in the code below

<cfheader name="Content-Disposition" value="attachment;filename=name_to_render_as.pdf">
<cfcontent type="application/pdf" file="path_to_pdf_file_on_server" deletefile="Yes">
yomexzo
  • 665
  • 1
  • 6
  • 22
  • 1
    Re: *had to save the file on the file system* You could also save it to a variable via the `result` attribute. Then use ``. – Leigh Aug 16 '13 at 20:48
  • True at that. Never considered. Thanks. Time to update my code. :) – yomexzo Aug 16 '13 at 20:56
  • @Leigh you mind acknowledging the fact that my answer is helpful by upping the vote? Thanks. – yomexzo Aug 17 '13 at 12:48
  • Leigh, the result attribute is not available when using the populate attribute of cfpdfform. – Lawyer_Coder Aug 18 '13 at 12:46
  • Hm.. I may have been thinking of the undocumented `name` attribute. If cfpdfform does not support it (which is silly, btw) you may need to save it to a physical file or possibly `ram://`. – Leigh Aug 20 '13 at 14:18