Re: moving uploaded files

From: Date: Fri, 14 Sep 2001 11:45:12 +0000
Subject: Re: moving uploaded files
Groups: php.db 
Request: Send a blank email to php-db+get-12444@lists.php.net to get a copy of this message
Hi, PHP has its own filesystem functions which you can use. If you want to move a file from one location to another you could use something like this <? copy($old_file,$new_file); unlink($old_file); ?> The $old_file and the $new_file variables should contain the absolute path e.g. /home/user/filename.txt Check http://www.php.net/manual/en/ref.filesystem.php for a more detailed explanation of the filesystem functions. HTH Dobromir Velev -----Original Message----- From: Jon Mormino <morminoj@sidwell.edu> To: php-db@lists.php.net <php-db@lists.php.net> Date: Thursday, September 13, 2001 11:10 PM Subject: [PHP-DB] moving uploaded files Does anyone have a solution for the following problem. I use dbwired.com for hosting (great service). They do not, however, for obviously reasons allow the system() command from a php script. So, when I switched to this server I had to switch from a system("mv file1 file2"); command to a move_uploaded_file("path1","path2"); command which is fine...for uploading. But, once a file is uploaded I can't figure out a way to move or delete it as it is no longer considered an "uploaded file" and hence move_uploaded_file() fails. Does anyone know a way around this? Thanks. -Jon Mormino -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#12444) next »