Jump to content

Warning: fopen(http://localhost/.. ?HTTP wrapper does not support writeable conn


sayedsohail

Recommended Posts

Hi everyone,

 

I am able to create a pdf using php and ezpdf, its works fine, and display the pdf document in the current server page.

 

But here are two things i wish to do, first store the pdf and than open, if possible in a new popup window?

 

When i tried this function below, it gives me an error

 

Error:

Warning: fopen(http://localhost/pdf/files/tmp1/yasmina.pdf) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections. in C:\Program Files\xampp\htdocs\pdf\pdfClassesAndFonts_009e\certificate.php on line 139

Could not open file to save PDF.

 

if (!isset($file)) 
    $pdf->ezStream(); 
else 
{ 

$file = "$temp_dir/tmp1/" . $fname . '.pdf'; 


if ($fp = fopen( "$temp_dir/tmp1/" . $fname . '.pdf', 'wb' )) { 
        fwrite( $fp, $pdf->ezOutput() ); 
        fclose( $fp ); 
        echo "<HTML><SCRIPT>document.location='$file';</SCRIPT></HTML>"; 
    } 
    else { 
        echo "Could not open file to save PDF.  "; 
        if (!is_writable( $temp_dir )) { 
            "The files/temp directory is not writable.  Check your file system permissions."; 
        } 
    } 
}  

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.