Jump to content


Image upload and overwrite??

  • Please log in to reply
1 reply to this topic

#1 kristofor

  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 10 May 2006 - 01:02 AM


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.


#2 akitchin

  • Staff Alumni
  • Advanced Member
  • 2,516 posts
  • LocationCalgary, AB, Canada

Posted 10 May 2006 - 02:19 AM

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.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users