1
0
Fork 0
mirror of https://github.com/24eme/signaturepdf synced 2024-05-19 22:26:38 +02:00

sharing folder existance and rights check

This commit is contained in:
Jb Lm 2022-04-01 10:35:30 +02:00
parent 7f2730decb
commit f884eb73ae

View file

@ -169,6 +169,12 @@ $f3->route('POST /share',
$hash = substr(hash('sha512', uniqid().rand()), 0, 20);
$sharingFolder = $f3->get('STORAGE').$hash."/";
$f3->set('UPLOADS', $sharingFolder);
if (!is_dir($f3->get('STORAGE'))) {
$f3->error(500, 'Sharing folder doesn\'t exist');
}
if (!is_writable($f3->get('STORAGE'))) {
$f3->error(500, 'Sharing folder is not writable');
}
mkdir($sharingFolder);
$filename = "original.pdf";
$tmpfile = tempnam($sharingFolder, date('YmdHis'));