Delete all images/files

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
AndyInDE
Posts: 6
Joined: Fri 9. Feb 2007, 16:18

Delete all images/files

Post by AndyInDE »

Is there a safe way/script to delete all images/files and article references to them (mysql).

The update to the latest version left many images corrupted (possibly an IM or GD problem on my machine, but strange that many images were also ok?).

It would now be more simple to just remove all images and references from everything. Then I could re-upload all images and re-reference them.

Thanks in advance.
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post by flip-flop »

Hi AndyInDE,

please have a look: http://faq.phpwcms-docu.de/content/2/6/ ... files.html

Regards Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
AndyInDE
Posts: 6
Joined: Fri 9. Feb 2007, 16:18

Post by AndyInDE »

Thanks flip-flop,
That was ok for 'unused' images.

I took a chance and just ended up deleting from 'phpwcms_file' and 'phpwcms_imgcache', and then deleting all images from /content/images and /phpwcms_filestorage (less the image_placeholder.png). The site is now clean (i.e. no images, which is what I wanted).

All that remains is to get the ftp import to work (not generating previews), which I am working on now. It seems that the filename passed to imagick.convert.inc.php is incorrectly trimmed somewhere?
AndyInDE
Posts: 6
Joined: Fri 9. Feb 2007, 16:18

Post by AndyInDE »

Ok, found the image problem. It seems that many tables did not get updated correctly during the upgrade.

Many of the varchar columns have not been increased in capacity. At a glance it looks like nearly all varchar(85) columns should have been upgraded to 255 etc.

In particular the phpwcms_file.f_hash was varchar(16), so this was where the filename was getting trashed.

I am not sure where this occurred, but this was an upgrade from a really old version.

I am doing a table by table script check to get everything in order.
AndyInDE
Posts: 6
Joined: Fri 9. Feb 2007, 16:18

Post by AndyInDE »

The varchar problem was definitely something to do with the DB upgrade from mysql 3.x to 4.x and charsets (the new mysqld was using an incorrect/old charset location). I think I'll leave the update to mysql 5.x till I'm sure I have a running system.

Everything appears to be correct at this stage, all that remains is to re-link the images.
Post Reply