Re: rename()

From: Date: Thu, 11 Sep 2003 19:19:28 +0000
Subject: Re: rename()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-162334@lists.php.net to get a copy of this message
From: "Edward Peloke" <epeloke@echoman.com> > This is probably an easy question Yep.. ;) > I have an uploaded image in a temp file that I want to rename and put in > another folder. I am using rename() which works fine, the problem is, I > want to force an overwrite if the file already exists. [snip] You should use move_uploaded_file(), which will overwrite the destination file if it exists. It also has the added security that rename() does not in that it will ENSURE the file actually came from an HTTP POST operation. http://us2.php.net/manual/en/function.move-uploaded-file.php ---John Holmes...

« previous php.general (#162334) next »