[drupal-devel] [bug] use upload_tmp_dir as default for FILE_DIRECTORY_TEMP

crunchywelch drupal-devel at drupal.org
Sat Sep 3 21:43:24 UTC 2005

Issue status update for 
Post a follow up: 

 Project:      Drupal
 Version:      4.6.2
 Component:    base system
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  danielc
 Updated by:   crunchywelch
-Status:       active
+Status:       patch (code needs review)

change status


Previous comments:

Sat, 02 Jul 2005 20:03:13 +0000 : danielc

In includes/file.inc, the FILE_DIRECTORY_TEMP constant is set as
  define('FILE_DIRECTORY_TEMP', IS_WINDOWS ? 'c:\\windows\\temp' :

It's wiser to set it to php.ini's upload_tmp_dir value:
  define('FILE_DIRECTORY_TEMP', ini_get('upload_tmp_dir'));

I noticed this issue because I'm running Windows 2000, which defaults
to an install directory of c:\winnt, not c:\windows.  When I go to the
"Settings" administration page, (while running PHP 5.0.5-dev) I got the
following error at the top of the page:

  warning: mkdir() [function.mkdir]: No such file or directory in
...\includes\file.inc on line 86.


Thu, 07 Jul 2005 13:05:36 +0000 : AlberT75

I had the same problem when installed on a host with open_base_dir
enabled (it should be on a decent hoster machine)...


Sat, 03 Sep 2005 21:42:49 +0000 : crunchywelch

Attachment: http://drupal.org/files/issues/file.inc.patch (635 bytes)

Here is a patch for this, seems like a good idea to me, works on a new
HEAD install on SUSe Linux.

More information about the drupal-devel mailing list