From 06979fa0168d929db8f0a7b0fd3c6bbe10b40ff6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 May 2023 05:58:18 +0200 Subject: [PATCH] Update api_documents.class.php --- htdocs/api/class/api_documents.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 9c357dc5679..1c4e7a8ea11 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -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');