From d0b2a3a823d478520111501b00a3e48980a98b39 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 20 Jun 2004 09:03:34 +0000 Subject: [PATCH] fix for 2 people importing an equally named file at the same time, thanks to Matthew Galgoci --- addressbook/csv_import.php | 2 +- calendar/csv_import.php | 2 +- infolog/csv_import.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addressbook/csv_import.php b/addressbook/csv_import.php index 9de0bd0829..7791792c12 100644 --- a/addressbook/csv_import.php +++ b/addressbook/csv_import.php @@ -21,7 +21,7 @@ if (isset($_FILES['csvfile']['tmp_name'])) { - $csvfile = $GLOBALS['phpgw_info']['server']['temp_dir'].'/addrbook_import_'.basename($csvfile); + $csvfile = tempnam($GLOBALS['phpgw_info']['server']['temp_dir'],$GLOBALS['phpgw_info']['flags']['currentapp']."_"); $GLOBALS['phpgw']->session->appsession('csvfile','',$csvfile); $_POST['action'] = move_uploaded_file($_FILES['csvfile']['tmp_name'],$csvfile) ? 'download' : ''; diff --git a/calendar/csv_import.php b/calendar/csv_import.php index 4a5ae91619..911876294b 100644 --- a/calendar/csv_import.php +++ b/calendar/csv_import.php @@ -25,7 +25,7 @@ } if (isset($_FILES['csvfile']['tmp_name'])) { - $csvfile = $GLOBALS['phpgw_info']['server']['temp_dir'].'/calendar_import_'.basename($csvfile); + $csvfile = tempnam($GLOBALS['phpgw_info']['server']['temp_dir'],$GLOBALS['phpgw_info']['flags']['currentapp']."_"); $GLOBALS['phpgw']->session->appsession('csvfile','',$csvfile); $_POST['action'] = move_uploaded_file($_FILES['csvfile']['tmp_name'],$csvfile) ? 'download' : ''; diff --git a/infolog/csv_import.php b/infolog/csv_import.php index 494c2e51c0..b792574794 100644 --- a/infolog/csv_import.php +++ b/infolog/csv_import.php @@ -26,7 +26,7 @@ } if (isset($_FILES['csvfile']['tmp_name'])) { - $csvfile = $GLOBALS['phpgw_info']['server']['temp_dir'].'/infolog_import_'.basename($csvfile); + $csvfile = tempnam($GLOBALS['phpgw_info']['server']['temp_dir'],$GLOBALS['phpgw_info']['flags']['currentapp']."_"); $GLOBALS['phpgw']->session->appsession('csvfile','',$csvfile); $_POST['action'] = move_uploaded_file($_FILES['csvfile']['tmp_name'],$csvfile) ? 'download' : '';