Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

errors when uploading a product image with same filename


Recommended Posts

hi there

having a, problem when uploading an image over the top of an existing image

im sure i used to be able to do this on another store


scenario is as follows


a product has three images





I get a newer image that id like to use in place of image 1

its also called image1.jpg


so i go to admin upload load it

and get errors


Warning: copy(/home/mystore/public_html/shop/images/image1.jpg) [function.copy]: failed to open stream: Permission denied in /home/mystore/public_html/catalog/admin/includes/image_resize.php on line 193

Warning: Cannot modify header information - headers already sent by (output started at /home/mystore/public_html/catalog/admin/includes/image_resize.php:193) in /home/mystore/public_html/catalog/admin/includes/functions/general.php on line 104



how can i make sure that this newer image will just overwrite the one thats already there?


if i upload image1_new.jpg it works fine

but i dont want to have rename the images as i get them alreayd named ..


anyone got any advice they can help with?


thanks in advance if you do!

Link to comment
Share on other sites

The page will not allow you to over-write images with the same file name. If you need to, use your FTP and delete the old images before you try to upload the new images.





Link to comment
Share on other sites

hi thanks for yuor reply

i do realize that

but im wondering how to set it up so newer uploaded images would overwrite the image thats there

so i dont have to go into ftp all the time


im sure i had it like that on a previous store


to do with permissions on the uploaded files?


but how to make sure an image is uploaded with the right permissions?

Link to comment
Share on other sites

Ok, here's the deal. It's a permissions thing...


You are considered the owner of the files that you upload with ftp, or your cPanel.

When a file is uploaded through the osC process, the owner of the file is the web server process. IF the web server process has it's own group and you are in it, then it would work right if the group permissions allow writing. On a shared server that is usually not the case. So, the web server process is usually a part of 'everyone.' Or, the world.


So, if you upload a file with ftp it is default marked as writable by the owner and group only, and not the world. Since the web server is part of the world, the permissions will not match...


So, your fix is likely to use your ftp program and set all images to be world writable. That way the web server process can overwrite them.



To see the minimum permissions required to do this, select a specific file and make it writable only by the owner. That's you. Try to overwrite it with the osC process. It will (should) fail. Then set it to be writable by the group you are in. Try to overwrite it with the osC process. It may work but will likely fail. And finally, set the file to be world writable. That should work. Use those permissions for all image files and any new image files you upload with ftp will have to be manually changed to those permissions.

Community Bootstrap Edition, Edge


Avoid the most asked question. See How to Secure My Site and How do I...?

Link to comment
Share on other sites


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

  • Create New...