note 91385 added to function.rename

From: Date: Tue, 09 Jun 2009 16:28:33 +0000
Subject: note 91385 added to function.rename
Groups: php.notes 
Request: Send a blank email to php-notes+get-156614@lists.php.net to get a copy of this message
I got some trouble with file upload using functions: rename, tmpname. PHP 5.2.5 is making cache I do not know why since I not called any function related to cache before. Using the move_uploaded_file does not show the problem with filesize. Here the example. if ( $_FILES ) { $tmp = tempnam( '/tmpdir', 'REN' ); if ( rename( $_FILES['test']['tmp_name'], $tmp ) ) print( 'Done ' ); print( 'Size of file moved: ' ); var_dump( filesize( $tmp ) ); clearstatcache(); print( 'Size of file moved: ' ); var_dump( filesize( $tmp ) ); } ?> <form method="post" name="renametest" enctype="multipart/form-data"> <input type="file" name="test"> <input type="submit" name="ok" value="go"> </form> ---- Server IP: 187.16.23.128 Probable Submitter: 143.54.23.131 ---- Manual Page -- http://www.php.net/manual/en/function.rename.php Edit -- https://master.php.net/note/edit/91385 Del: integrated -- https://master.php.net/note/delete/91385/integrated Del: useless -- https://master.php.net/note/delete/91385/useless Del: bad code -- https://master.php.net/note/delete/91385/bad+code Del: spam -- https://master.php.net/note/delete/91385/spam Del: non-english -- https://master.php.net/note/delete/91385/non-english Del: in docs -- https://master.php.net/note/delete/91385/in+docs Del: other reasons-- https://master.php.net/note/delete/91385 Reject -- https://master.php.net/note/reject/91385 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#156614) next »