mirror of
https://codeberg.org/SeedDMS/paperless
synced 2025-02-06 06:55:28 +00:00
fix getting uploaded files with PSR7
This commit is contained in:
parent
54d4d2c41a
commit
1c09c1ba4e
|
@ -1413,7 +1413,8 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
||||||
$cats[] = $cat;
|
$cats[] = $cat;
|
||||||
}
|
}
|
||||||
|
|
||||||
$userfiletmp = $file_info->file;
|
$userfiletmp = tempnam(sys_get_temp_dir(), 'paperless');
|
||||||
|
file_put_contents($temp, (string) $file_info->getStream());
|
||||||
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
$finfo = finfo_open(FILEINFO_MIME_TYPE);
|
||||||
$userfiletype = finfo_file($finfo, $userfiletmp);
|
$userfiletype = finfo_file($finfo, $userfiletmp);
|
||||||
$fileType = ".".pathinfo($origfilename, PATHINFO_EXTENSION);
|
$fileType = ".".pathinfo($origfilename, PATHINFO_EXTENSION);
|
||||||
|
@ -1507,10 +1508,8 @@ class SeedDMS_ExtPaperless_RestAPI_Controller { /* {{{ */
|
||||||
if($notifier) {
|
if($notifier) {
|
||||||
$notifier->sendNewDocumentMail($document, $userobj);
|
$notifier->sendNewDocumentMail($document, $userobj);
|
||||||
}
|
}
|
||||||
if($settings->_removeFromDropFolder) {
|
if(file_exists($userfiletmp)) {
|
||||||
if(file_exists($userfiletmp)) {
|
unlink($userfiletmp);
|
||||||
unlink($userfiletmp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$response->getBody()->write('OK');
|
$response->getBody()->write('OK');
|
||||||
return $response->withStatus(200);
|
return $response->withStatus(200);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user