sayedsohail Posted August 17, 2007 Share Posted August 17, 2007 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."; } } } Quote Link to comment https://forums.phpfreaks.com/topic/65527-warning-fopenhttplocalhost-http-wrapper-does-not-support-writeable-conn/ Share on other sites More sharing options...
sayedsohail Posted August 18, 2007 Author Share Posted August 18, 2007 now everything is solved, can someone advise, how to check if the file exists and prompt the user to create new one or open the existing file? Quote Link to comment https://forums.phpfreaks.com/topic/65527-warning-fopenhttplocalhost-http-wrapper-does-not-support-writeable-conn/#findComment-327236 Share on other sites More sharing options...
Fadion Posted August 18, 2007 Share Posted August 18, 2007 to check if the file exists use <a href="http://www.php.net/file_exists">file_exists()</a>. Quote Link to comment https://forums.phpfreaks.com/topic/65527-warning-fopenhttplocalhost-http-wrapper-does-not-support-writeable-conn/#findComment-327243 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.