diff --git a/lib/util.php b/lib/util.php index c7ab7fa0e..d8e5655e4 100755 --- a/lib/util.php +++ b/lib/util.php @@ -544,10 +544,12 @@ if (!function_exists('temp_file')) { $name = secure_random_string(); } - $file = DIRECTORY_SEPARATOR. + /*$file = DIRECTORY_SEPARATOR. trim(sys_get_temp_dir(), DIRECTORY_SEPARATOR). DIRECTORY_SEPARATOR. - ltrim($name, DIRECTORY_SEPARATOR); + ltrim($name, DIRECTORY_SEPARATOR);*/ + + $file = implode(DIRECTORY_SEPARATOR, [base_dir(), 'files', 'temp', ltrim($name, DIRECTORY_SEPARATOR)]); file_put_contents($file, $content); diff --git a/modules/fatture/bulk.php b/modules/fatture/bulk.php index 6b5570692..fbdf919bb 100755 --- a/modules/fatture/bulk.php +++ b/modules/fatture/bulk.php @@ -431,7 +431,8 @@ switch (post('op')) { break; case 'export-csv': - $file = temp_file(); + $file = temp_file().'.csv'; + $exporter = new CSV($file); // Esportazione dei record selezionati