#32023 [Opn->Bgs]: move_uploaded_file ignore destination and put to default tmp

From: Date: Mon, 21 Feb 2005 17:54:52 +0000
Subject: #32023 [Opn->Bgs]: move_uploaded_file ignore destination and put to default tmp
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-74340@lists.php.net to get a copy of this message
 ID:               32023
 Updated by:       tony2001@php.net
 Reported By:      sopak at matrixway dot cz
-Status:           Open
+Status:           Bogus
 Bug Type:         Filesystem function related
 Operating System: linux
 PHP Version:      4.3.10
 New Comment:

move_uploaded_file() doesn't use any PHP ini options, so it can't move
files to "default tmp dir", as it doesn't know about it.
Check your code and always use absolute path. 


Previous Comments:
------------------------------------------------------------------------

[2005-02-18 18:29:51] sopak at matrixway dot cz

Description:
------------
move_uploaded_file ignore destination 

if destination  contains  any relative path function will put file to
default tmp(and no error message is sent, and strip relative path) ,
without(move to actual position) path or with absolute path will
function move file to right destination

I used php 4.3.10
safe_mode on
base_dir I checked  twice ;]

I can tell this  bug was not in 4.3.9

Reproduce code:
---------------
                                                               
$downloadDir="./tmp"; //local TMP dir in my space
                                                               
$file=$downloadDir."upload_".md5($HTTP_POST_FILES['file']['tmp_name']);
                                                               
move_uploaded_file($HTTP_POST_FILES['file']['tmp_name'],$file);
                                                                
//file  is  stored in /tmp/$file have to be  in ./tmp/$file



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=32023&edit=1


Thread (2 messages)

« previous php.bugs (#74340) next »