Index: includes/file.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/file.inc,v retrieving revision 1.48 diff -u -r1.48 file.inc --- includes/file.inc 13 Sep 2005 19:05:34 -0000 1.48 +++ includes/file.inc 1 Nov 2005 13:10:37 -0000 @@ -12,12 +12,10 @@ * Common file handling functions. */ -define('IS_WINDOWS', substr(PHP_OS, 0, 3) == 'WIN'); define('FILE_DOWNLOADS_PUBLIC', 1); define('FILE_DOWNLOADS_PRIVATE', 2); define('FILE_CREATE_DIRECTORY', 1); define('FILE_MODIFY_PERMISSIONS', 2); -define('FILE_DIRECTORY_TEMP', IS_WINDOWS ? 'c:\\windows\\temp' : '/tmp'); define('FILE_EXISTS_RENAME', 0); define('FILE_EXISTS_REPLACE', 1); define('FILE_EXISTS_ERROR', 2); @@ -59,7 +57,7 @@ return $dest; } // check if the destination is instead inside the Drupal temporary files directory. - else if (file_check_location($dest, variable_get('file_directory_temp', FILE_DIRECTORY_TEMP))) { + else if (file_check_location($dest, variable_get('file_directory_temp', ini_get('upload_tmp_dir')))) { return $dest; } // Not found, try again with prefixed dirctory path. @@ -363,7 +361,7 @@ // Make sure $source exists in $_FILES. if ($file = file_check_upload($source)) { if (!$dest) { - $dest = variable_get('file_directory_temp', FILE_DIRECTORY_TEMP); + $dest = variable_get('file_directory_temp', ini_get('upload_tmp_dir')); $temporary = 1; if (is_file($file->filepath)) { // If this file was uploaded by this user before replace the temporary copy. @@ -421,7 +419,7 @@ return 0; } - $temp = variable_get('file_directory_temp', FILE_DIRECTORY_TEMP); + $temp = variable_get('file_directory_temp', ini_get('upload_tmp_dir')); $file = tempnam($temp, 'file'); if (!$fp = fopen($file, 'wb')) { drupal_set_message(t('The file could not be created.'), 'error'); Index: modules/system.module =================================================================== RCS file: /cvs/drupal/drupal/modules/system.module,v retrieving revision 1.249 diff -u -r1.249 system.module --- modules/system.module 1 Nov 2005 10:17:34 -0000 1.249 +++ modules/system.module 1 Nov 2005 13:09:16 -0000 @@ -325,7 +325,7 @@ '#description' => t('A file system path where the files will be stored. This directory has to exist and be writable by Drupal. If the download method is set to public this directory has to be relative to Drupal installation directory, and be accessible over the web. When download method is set to private this directory should not be accessible over the web. Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.') ); - $directory_temp = variable_get('file_directory_temp', FILE_DIRECTORY_TEMP); + $directory_temp = variable_get('file_directory_temp', ini_get('upload_tmp_dir')); file_check_directory($directory_temp, FILE_CREATE_DIRECTORY, 'file_directory_temp'); $form['files']['file_directory_temp'] = array(