I'm working with fpdf libray for providing pdf files. A part of my project consists of using this library to generate pdf files for consumers. We are working with a server test under "ovh". The arborescence of my space in "ovh" is : /www/betatest.
A folder named upload which contains factures's folder where all the facture's pdf files will be there. So, when i try to generate a pdf file inside the factures folder, in a web browser it displays me :
Warning: fopen(upload/factures/facture_98.pdf) [function.fopen]: failed to open stream: Success in /homez.742/coplayer/www/betatest/library/fpdf/fpdf.php on line 1025
FPDF error: Unable to create output file: upload/factures/facture_98.pdf.
I tried a lot of things that i found in this web site but does not work. Please help me. Thank's a lot! :)
Make sure the directory have at least a 755
. Also, use $_SERVER['DOCUMENT_ROOT']
with your path to target the good directory :
$nomFacture = $_SERVER['DOCUMENT_ROOT']."upload/factures/facture_".$idFacture.".pdf";
That will produce something like
/homez.742/coplayer/www/betatest/upload/factures/facture_12.pdf
Make sure you have not sending to output something else (like echo
, var_dump
, etc.) before generating PDF with Output("path_file", "F")
. It is mandatory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With