note 21716 added to function.move-uploaded-file

From: Date: Fri, 24 May 2002 02:56:33 +0000
Subject: note 21716 added to function.move-uploaded-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-30967@lists.php.net to get a copy of this message
For those who doesn't have move_uploaded_file (for version reasons) and are using copy (with the error) there is one more problem (independetly of the basedir restriction): If you copy the file, you will need double the space required to store the file for just the script's execution time, this may be a problem with very large files. I use the shell command mv with the backtick operator: $status = mv $attach $finalfilename; this workaround doesn't have the basedir restriction and uses only 1x of the file size at a time. BUT BE SURE TO escapeshellcmd THE finalfilename TO AVOID SHELL COMMAND INJECTION!!! -- http://www.php.net/manual/en/function.move-uploaded-file.php http://master.php.net/manage/user-notes.php?action=edit+21716 http://master.php.net/manage/user-notes.php?action=delete+21716 http://master.php.net/manage/user-notes.php?action=reject+21716

« previous php.notes (#30967) next »