Update api_documents.class.php

This commit is contained in:
Laurent Destailleur 2023-05-02 05:58:18 +02:00 committed by GitHub
parent 4d42279fcd
commit 06979fa016
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -756,9 +756,9 @@ class Documents extends DolibarrApi
throw new RestException(500, "File with name '".$original_file."' already exists.");
}
// in case temporary directory doesn't exist
if (!dol_is_dir(dirname(DOL_DATA_ROOT . '/admin/temp/'))) {
dol_mkdir(DOL_DATA_ROOT . '/admin/temp/');
// in case temporary directory admin/temp doesn't exist
if (!dol_is_dir(dirname($destfiletmp))) {
dol_mkdir(dirname($destfiletmp));
}
$fhandle = @fopen($destfiletmp, 'w');