Thanks John,

I had actually looked that one up not to long ago...I just had a nice
'ping-pong' break (helps me think :)) and I might re-write it anyway, but I
will still be using the move_uploaded_file() this time.


-----Original Message-----
From: CPT John W. Holmes []
Sent: Thursday, September 11, 2003 3:19 PM
To: Edward Peloke; Php-GeneralLists. Php. Net
Subject: Re: [PHP] rename()

From: "Edward Peloke" <>
> 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.

---John Holmes...