2 Replies Latest reply on Oct 16, 2011 11:59 PM by Owain North

    CFDOCUMENT exception error - (write)

    CFML_MANIAC

      Here's the code:

       

      <cfset the_file_name = 'somename'>

      <cfdocument format='pdf' filename='D:\Domains\domainname.net\wwwroot\#the_file_name#.pdf' overwrite='true'>

      <font face="arial" size="2">Test</font>

      </cfdocument>

       

      When I run this, I get the following error:

      -----------------------------------------------------------------------------------------

      An exception occurred when performing document processing.

       

      The cause of this exception was that: java.security.AccessControlException: access denied (java.io.FilePermission D:\Domains\domainname.net\wwwroot\somename.pdf write).

      -----------------------------------------------------------------------------------------

       

      This error, as I understand it, is telling me that the 'write' permissions need to be turned on for the directory in question.

       

      The write permission -are- turned on.   I have also tried to use a different directory path in the filename attribute,  as well as no path at all,  and keep getting the same error.   There are no images being used in the generated PDF,  so it isn't a problem with not being able to find an image file.

       

      Any ideas why I'm getting the error?

       

      Thanks,

      Wheis

        • 1. Re: CFDOCUMENT exception error - (write)
          CFML_MANIAC Level 1

          To test a theory,  and to narrow down possible issues,  I created the following code:

           

          <cfdocument format="pdf" filename="test.pdf" overwrite="true">

          test

          </cfdocument>

           

           

          Seems simple enough.

           

          I get the same error when I try to run it.  'java.security.AccessControlException: access denied'

           

          I've quadruple-checked my site setup and the directory has write permissions enabled.

           

          Is there something in the CF administrator that has to be set as well?   I haven't found anything that says there's any special settings for permissions when using cfdocument, but I guess that doesn't mean there aren't any.

           

          Thanks again,

          WHeis

          • 2. Re: CFDOCUMENT exception error - (write)
            Owain North Level 4

            When you say the "directory has write permissions enabled", where do you mean? In IIS? You need to set NTFS write permissions on that folder for whichever user ColdFusion itself is running under. At the risk of being patronising:

             

            a) On the server, run services.msc. Find the ColdFusion Application Server and check its "Log on as" column. That's the NT user it's running as.

            b) Find the folder, properties, Security - add in Full Control for that user.

             

            Should sort you out.