0

I have gotten my code to work up until now. I have a set of code that when it gets called it generates a pdf file and is supposed to store it in a given file. I am using the Output('filename.pdf', 'F') and I don't see any files being stored. I have confirmed the file does download effectively using the 'I' and the 'D'. When I try the F I don't get any errors and it appears all has worked but when i check the folder it's empty. Could this be a permissions thing? Another question is if I give a path weather it is a directory or a path for a file is it supposed to work? Assuming this gets accessed by people in under the same network.. Below is my code:

define("TEMP_PDF_DIR", "C:\\Temp\\Waiver\\");
$pdf is created form class....
$pdfFile = TEMP_PDF_DIR . 'Waiver_'. $name . '.pdf';
$pdf addPage()..
...
$pdf->Output( $pdfFile, 'F');

again all works when I download it instantly or open it to then download it.

Cookies
  • 107
  • 1
  • 1
  • 13
  • `$pdf->Output` is a custom function from a custom object.. need more details about the implementation to help you – Ruby Junior Dev Jun 18 '19 at 17:42
  • You have the parameters for the `output` method backwards. It should be `$pdf->Output( 'F',$pdfFile);`. If you aren't going to use `TEMP_PDF_DIR` anywhere else just put everything directly into the `output` method as in: `$pdf->Output('F','C:/Temp/Waiver/Wailver_' . $name . '.pdf');`. – Dave Jun 18 '19 at 17:46
  • If you're doing this from a web browser make sure that the user the web browser is running has has write permission to the `Temp/Waiver` directory. – Dave Jun 18 '19 at 17:46
  • Unless you look *and* check for concrete errors, this is unanswerable. – mario Jun 18 '19 at 17:53
  • And as I said in my first comment to your [last question](https://stackoverflow.com/questions/56639214/pdf-file-not-downloading-or-being-saved-to-folder) about this make sure all error reporting is enabled `ini_set('display_errors', 1);ini_set('display_startup_errors', 1);error_reporting(E_ALL);`. – Dave Jun 18 '19 at 17:56
  • Yeah I have been using the ini_set('display_errors', 1);ini_set('display_startup_errors', 1);error_reporting(E_ALL); I don't seem to get anything back – Cookies Jun 18 '19 at 19:28

0 Answers0