Page 1 of 1
delete/update images
Posted: Sun Aug 31, 2008 8:01 am
by boraz
I can't delete or change image's file. I've upgraded to version 0.7.8 and the problem still exists. When i'm trying to delete the image's entry it's actually removed from the database but the image FILE still sits in image and cache folders. It's also impossible to update image with a new one (new image won't even upload). Why does nobody report it? Could anyone fix this, please?
Re: delete/update images
Posted: Sun Aug 31, 2008 9:19 am
by Luvz2drv
boraz wrote:
I can't delete or change image's file. I've upgraded to version 0.7.8 and the problem still exists. When i'm trying to delete the image's entry it's actually removed from the database but the image FILE still sits in image and cache folders. It's also impossible to update image with a new one (new image won't even upload). Why does nobody report it? Could anyone fix this, please?
fastest fix is to rename you file that you are goign to upload or use FTP and delete the image form the images folder
Re: delete/update images
Posted: Sun Aug 31, 2008 5:29 pm
by jty
Do you have a permissions problem?
I just installed on my web host for the first time today and I encountered permission problems. I ended up setting permissions to my images folders to 777

Re: delete/update images
Posted: Sun Aug 31, 2008 7:38 pm
by boraz
jty wrote:
Do you have a permissions problem?
I just installed on my web host for the first time today and I encountered permission problems. I ended up setting permissions to my images folders to 777 ::)
My images folder is set to 777 also. Images are uploading without a problem, but i can't delete them or update.
Luvz2drv - yes, that's the fastest fix, but i'd like the image module to actually work. Maybe anyone could check what's wrong with the code and suggest another fix? This is really annoying. Thanks
Maybe the imagefile itself needs to have chmod 777 so it can be deleted?
Re: delete/update images
Posted: Sun Aug 31, 2008 8:48 pm
by jty
boraz wrote:
Maybe the imagefile itself needs to have chmod 777 so it can be deleted?
I was going to suggest this. Not only set the permission for the folder but also set the permission for the files
I had my image folder set to 666 (I think it was set to 666). This resulted in my image files set to 000. I've never seen a 000 before
I then set my folder permission to 777 but the files stayed at 000. I had to set the permissions for the "files" to fix it.
Re: delete/update images
Posted: Mon Sep 01, 2008 2:05 am
by boraz
Ok, my dir and files are now chmod to 777 with
Code: Select all
chmod(DIR_IMAGE . $upload->getName('image'), 0777);
but i'm still unable to delete them or update

I've searched the forums and found that when removing 'if' condition from
Code: Select all
if ($upload->has('image')) {
$sql = "update image set filename = '?' where image_id = '?'";
$database->query($database->parse($sql, $upload->getName('image'), $request->get('image_id')));
}
the update succesfully works. Can anyone explain me why that's happening?
I'd be really thankfull.
Re: delete/update images
Posted: Sat Dec 20, 2008 1:44 am
by hm2k
Re: delete/update images
Posted: Fri Jan 02, 2009 5:35 am
by yl
I use o.7.9 rc5. I want to delete an image from admin/catalog/images, as I have the product deleted. I am not able to do it because it said "This Image cannot be deleted as it is currently assigned to 11 categories! or it would say assigned to manufacturer". Is there any coding to take this action effectively?
Re: delete/update images
Posted: Fri Jan 02, 2009 5:55 am
by bruce
My suggestion is to upload an "image coming soon" type image and/or a transparent single pixel image as a "no image" placeholder and apply that image to your manufacturers and categories. After doing this, you should be able to delete your unused product image.
Re: delete/update images
Posted: Fri Jan 02, 2009 6:21 am
by Qphoria
I haven't tested this, but adding a "blank" option for the image drop down and setting it to that value should release the image if you set each of the 11 categories to blank
See here how to add a blank (or no image) option
http://forum.opencart.com/index.php/top ... l#msg12255
Or
Are you asking if there is a way to force the delete and automatically delete the reference to this image in the database? It could be done but is not yet implemented
Re: delete/update images
Posted: Sat Jan 03, 2009 1:21 am
by yl
Thank you both of you. It did solve the problem.
Yes, Q. It is it... it will be more functional.