file system permissions of created pdf
jarekgol opened this issue · 1 comments
jarekgol commented
Hi!
I've got piece of code that generate pdf's and store it on Linux server. I want to add group write permission. How can I do it?
$CakePdf = new \CakePdf\Pdf\CakePdf();
$CakePdf->template('renderfaktura');
$CakePdf->viewVars(['faktura' => $faktura[0],'zbiorcza' => $zbiorcza]);
$katalog = '';
if($entity->typ == 'zlom')
$katalog = 'zlom';
else
$katalog = $wz->order->client_id;
$path = DOKUMENTY . $katalog . DS . sprintf('Faktura_%s_%s_%s.pdf', $id_fakturowy_array[0], $id_fakturowy_array[1], $id_fakturowy_array[2]);
$pdf = $CakePdf->write($path);
is there $CakePdf->some_function();
to set this permissions?
ADmad commented
There isn't. Just use chmod() on the path to set required perms after file is created.