Jump to content


This topic is now archived and is closed to further replies.


Image upload and overwrite??

Recommended Posts


I have a customer who runs a compeptition and they have 2 monthly winners. Each month they want to upload 2 new images to replace the old images, now in interest of saving space on the web server, I need to be able to upload the new images and have them take the same file name as the old image and pretty much just overwrite the old image.

How would I go about overwriting the old image with the new image keeping the same filename??

Any help would be greatly appreciated.


Share this post

Link to post
Share on other sites
straight from the horse's mouth (ie. php manual):

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Warning

If the destination file already exists, it will be overwritten. [/quote]

problem solved - use move_uploaded_file(), which you should be using anyhow, with a static filename and you're all set.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.