Jump to content

Recommended Posts

Hi,

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.

Thanks
Kris
Link to comment
https://forums.phpfreaks.com/topic/9435-image-upload-and-overwrite/
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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.