Skip to main content
Inspiring
July 19, 2021
Question

<cfdocument> PDF file throwing java.io.FileNotFoundException (Permission Denied)

  • July 19, 2021
  • 1 reply
  • 373 views

Good afternoon,

 

     CF 2018 installed on a CentOS 7 server.  I'm having what seems like a permission issue when using tag:<cfdocument>, PDF generated file.  The error report indicates "java.io.FileNotFoundException" <path to PDF file> (Permission denied).  This is happening for all PDF generated files using <cfdocument>.  Has anyone had experience with granting the appropriate permissions to generate these PDF files on linux?  I'm guessing the ColdFusion user needs to be granted the appropritate permissions to generate the file, or this is something having to do with the way the hosted server is setup in regards to network security.  Any insight will be much appreciated.

 

Thanks,

 

-Daniel

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    August 6, 2021

    I also think it's got to do with granting ColdFusion permissions to write a PDF to a particular file path. Use try/catch, and you will get more information:

     

    <cftry>
    <cfdocument format="PDF" filename="absolute_path_for_pdf_file" >
    	ABC
    </cfdocument>
    <cfcatch type="any" >
    	<cfdump var="#cfcatch#" >
    </cfcatch>
    </cftry>