Simple answer is, you can't do it. If you want to define the name of
the pdf document in the save, or email buttons, it has to be available
on the server and embedded the same (not exactly the same) way you
embed a flash (swf) movie.
Depends on how secure you want these documents to be I guess.
Cheers
Gareth.
AJ Mercer wrote:
I want to be able to open the PDF in the browser (not
prompted to save as download).
When they click on the save button in the acrobat tool bar, it
currently names the file after the ColdFusion script - in your example
(
download.cfm) it would name the file download.pdf
If the email button is clicked, and attachment is chosen, the file that
is attached to the email is named after the ColdFusion script exactly,
ie, download.cfm - which is no good when you go to open it.
>From my testing, I am getting the same results using cfdocument or the
cfheader methods.
What I am trying to achieve is give the PDF a default file name.
And at the same time, I don't want the file left on the server.
The main purpose of the PDF is to get a print friendly document. But it
would be nice to resolve this issue if the user decides they would
rather print or email.
On 11/3/06, Joel Cass <[EMAIL PROTECTED]> wrote:
I am not
sure exactly what you are trying to do as I've never mucked around with
cfdocument, but the way that I use a lot for serving out files for
clients to save to disk is:
.../download.cfm/myfilename.pdf
[or whatever]
in your
download.cfm, look up cgi.path_info (note that this value differs when
not specified in some CF versions), and then serve out the file from
there
e.g.
<cfif
len(cgi.path_info) AND cgi.path_info IS NOT cgi.script_name>
<cfset fn = listLast(cgi.path_info,"/")> (optional)
<cfcontent
reset=true ...>
<cfheader
...>
<cfoutput...
etc
OR
<cfcontent file=...>
</cfif>
My 2 cents
Joel
Is it possible to
give a pdf created by cfdocument a filename that will be used by the
client when they click save or email as attachment?
At the moment, the save option comes up the the ColdFusionscript name
with .cfm replaced with .pdf.
The email as attachment option just puts it the cf script name - with
the .cfm extension, so for me it DreamWeaver tries to open it.
I would rather not go with the option of using cfdocument to save the
pdf on the server then push that out using
<cfheader name="Content-Disposition" value="inline; filename=Listing
#listing_no#.ext">
I am now messing around with the cfheader in the cfdocument, but so far
with out any luck.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---
|