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."; 
        } 
    } 
}  

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.