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:
parent
7f2730decb
commit
f884eb73ae
6
app.php
6
app.php
|
@ -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'));
|
||||
|
|
Loading…
Reference in a new issue