jeudi 3 septembre 2015

Save PDF file with Dompdf

using Dompdf to store data in pdf file:

This function work fine :

$pdf = \App::make('dompdf.wrapper');
$pdf->loadHTML('<h1>Test</h1> ');
return $pdf->stream();

Now,when try

$pdf = \App::make('dompdf.wrapper');
$pdf->loadHTML('<h1>Test</h1> ');
file_put_contents("test.pdf", $pdf->output());

Get error:

file_put_contents(test.pdf): failed to open stream: Permission denied

Do I need to create some extra folder for saving file or something ?

Tnx, P



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1hBXg8S
via IFTTT

1 commentaire:

  1. I recently solved this issue, sience the error you have is permessions, you got to give permession to the specified file, in your case 'test.pdf'.

    RépondreSupprimer