Skip to main content
Inspiring
May 12, 2008
Answered

Can i save pdf in a folder...How?...Please help.

  • May 12, 2008
  • 5 replies
  • 1348 views
Friends,

I am trying to create pdf file and save in a folder. So i can email pdf using cfmailparam.

<cfset filevar=#emp_no#&"_"&#dateformat(now(),'mm/dd/yyyy')#>
<cfdocument format="pdf" srcfile="#pdfpath#" filename="#filevar#" overwrite="yes">

i am getting an error...

same code...i created pdf using<cfdocument></cfdocument>...works fine...

but when i change to this...<cfdocument format="pdf" srcfile="#pdfpath#" filename="#filevar#" overwrite="yes">

code is throwing an error...
An exception occurred when performing document processing. The system cannot find the path specified.

Please help me....
    This topic has been closed for replies.
    Correct answer Dan_Bracuk
    Your filename attribute needs the path to the file as well as it's name.

    5 replies

    AdomacroAuthor
    Inspiring
    May 13, 2008
    thanks Dan..worked fine

    u r so sweet.
    Dan_BracukCorrect answer
    Inspiring
    May 12, 2008
    Your filename attribute needs the path to the file as well as it's name.
    Inspiring
    May 12, 2008
    Are you sure you are looking in right folder? Try looking in the same folder as the template containing your code.
    AdomacroAuthor
    Inspiring
    May 12, 2008
    thanks Dan,

    i am confused.

    I am creating a pdf and trying to save to a folder.

    Please post correct code syntax.

    thanks for ur help
    AdomacroAuthor
    Inspiring
    May 12, 2008
    Thanks Azadi. Changed the code..

    cfset filevar=#emp_no#&"_"&#dateformat(now(),'mm_dd_yyyy')#>
    <cfdocument format="pdf" srcfile="#pdfpath#" filename="#filevar#" overwrite="yes">

    Now code is running without any error.

    but pdf file is not created and saved in the folder...why?.

    Do i need more attribute for this?.
    Inspiring
    May 12, 2008
    you can't have / in a filename.

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/