fopen(); "Remote host file access not accepted" on a local file?

From php-Script you can use:

$pdf->Output(__DIR__ . '/invoices/Delivery Note.pdf', 'F');

After upgrading to the tcpdf 6.2.6 in vtiger 6.2 I've had the same problem, sending e-mail with pdf.

So I have changed the file:

 libraries/tcpdf/include/tcpdf_static.php

I have commented the code in fopenLocal() and changed the line

 fopen($_SERVER['DOCUMENT_ROOT'].$filename, $mode);

see:

  /**
         * Wrapper to use fopen only with local files
         * @param filename (string) Name of the file to open
         * @param $mode (string) 
         * @return Returns a file pointer resource on success, or FALSE on error.  
         * @public static
         */
        public static function fopenLocal($filename, $mode) {
    //      if (strpos($filename, '://') === false) {
    //          $filename = 'file://'.$filename;
    //      } elseif (strpos($filename, 'file://') !== 0) {
    //          return false;
    //      }
            return fopen($_SERVER['DOCUMENT_ROOT'].$filename, $mode);
        }

After changing this, it worked.

Tags:

Php

Fopen