25 if ((!is_array($_FILES)) || empty($_FILES)) exit();
28 require_once dirname(dirname(dirname(__FILE__))).
'/include/init.inc';
31 if (empty($GLOBALS[
'SQ_SYSTEM']->user) || !$GLOBALS[
'SQ_SYSTEM']->user->canAccessBackend()) {
32 trigger_localised_error(
'SYS0028', E_USER_ERROR);
37 require_once SQ_FUDGE_PATH.
'/general/file_system.inc';
38 $ms = $GLOBALS[
'SQ_SYSTEM']->getMessagingService();
40 foreach ($_FILES as $id => $details) {
41 if (is_array($details[
'name'])) {
42 foreach ($_FILES[$id][
'name'] as $index => $name) {
44 $file_name = strtolower(str_replace(
' ',
'_', $name));
45 while (file_exists(SQ_TEMP_PATH.
'/'.$file_name)) $file_name = increment_filename($file_name);
46 if (move_uploaded_file($_FILES[$id][
'tmp_name'][$index], SQ_TEMP_PATH.
'/'.$file_name)) {
47 print(
"\nOK ".$file_name.
"\n");
49 trigger_localised_error(
'SYS0009', E_USER_WARNING);
54 if (!empty($details[
'name'])) {
55 $file_name = strtolower(str_replace(
' ',
'_', $details[
'name']));
56 while (file_exists(SQ_TEMP_PATH.
'/'.$file_name)) $file_name = increment_filename($file_name);
57 if (move_uploaded_file($_FILES[$id][
'tmp_name'], SQ_TEMP_PATH.
'/'.$file_name)) {
58 print(
"\nOK ".$file_name.
"\n");
60 trigger_localised_error(
'SYS0009', E_USER_WARNING);