mirror of
https://github.com/24eme/signaturepdf.git
synced 2023-08-25 09:33:08 +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 New Issue
Block a user