From:             stloukal at programator dot cz
Operating system: FC4, 2.6.17
PHP version:      5.2.1
PHP Bug Type:     Filesystem function related
Bug description:  move_uploaded_file - target directory's name problem

Description:
------------
Hello,

I have a problem with move_uploaded_file() function which doesn't move the
uploaded file. No errors or warnings are thrown, only false is returned.
Problem occurs only if target directory is RELATIVELY addressed and it is
named "tmp".

It seems, that this is the same problem:
http://bugs.php.net/bug.php?id=32456

Reproduce code:
---------------
$path = '../../tmp/'.$_FILES['soubor']['name']; // this is not the system
tmp directory

echo 'uploaded: '.$_FILES['soubor']['tmp_name'].' =
'.(int)file_exists($_FILES['soubor']['tmp_name']);

move_uploaded_file($_FILES['soubor']['tmp_name'], $path);

echo ' moved: '.$path.' = '.(int)file_exists($path);


Expected result:
----------------
uploaded: /home/chroot/tmp/phpcLIB4C = 1 
moved: ../../tmp/galerie_2001_image001jpg.jpg = 1

Actual result:
--------------
uploaded: /home/chroot/tmp/phpcLIB4C = 1 
moved: ../../tmp/galerie_2001_image001jpg.jpg = 0

-- 
Edit bug report at http://bugs.php.net/?id=40537&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40537&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40537&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40537&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40537&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40537&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40537&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40537&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40537&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40537&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40537&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40537&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40537&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40537&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40537&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40537&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40537&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40537&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40537&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40537&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40537&r=mysqlcfg

Reply via email to