News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How to delete orphan attachments files

Started by EL34, March 21, 2014, 10:38:51 AM

Previous topic - Next topic

EL34

SMF1.1.19

Looking at my forums attachment file maintenance page shows that the total attachments are 14,838

Looking at the attachment folder on my server shows that there are 29,100 attachments in that folder.

First question is, does SMF delete the attachment files when you delete old post?
Second question would be, how can I figure out which attachment files are orphans, not linked to any post?

I want to slim down the attachments folder by deleting any non used files

Thanks
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

a10

Hello, is it pictures and using thumbnails? Then it's 14,838 x2.
29100 would be 'somewhat' in the correct range.

Attachment (and it's thumbnail) is deleted from server when deleted from post, or the post is deleted (at least always done that here).

As for how to locate\delete eventual orphans, I too would be interesting to know about that.

btw, EL34... Tube? Mullard?
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

EL34

Hi a10,
I was wondering if the attachments got deleted when purging old post, so it seems that they do

counting the thumbnails makes sense
not all files have thumbnails so that makes the total count work out about right
All files do not need to be reduced if they are under a certain size

yes, EL34 is a valve/tube
name your brand, any brand, Mullard is a good one  :D
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

a10

Testing attachment behavior, making a post with some picture\thumbnail, seeing them as the 2 latest entries in folder on server, then delete the post, and refresh server list to check that latest 2 files gone.

...................
About EL34's, when young(er) used to buy new Mullard, Telefunken, Philips for my guitaramps. A few USD a piece, if one only knew then what the future would bring...
2.0.19, php 8.0.23, MariaDB 10.5.15. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

EL34

Quote from: a10 on March 21, 2014, 06:48:05 PM
Testing attachment behavior, making a post with some picture\thumbnail, seeing them as the 2 latest entries in folder on server, then delete the post, and refresh server list to check that latest 2 files gone.

...................
About EL34's, when young(er) used to buy new Mullard, Telefunken, Philips for my guitaramps. A few USD a piece, if one only knew then what the future would bring...

Yeah, I did the same test as you a little while ago with the post add, attachment, delete. check the server folders

You would be a rich man if you had stashed a bunch of those valves away.
Just like 50's Gibson & Fender guitars, Old fender amps,  AC cobras, shelby Mustangs, Gold and Silver coins, etc............................  ;D
Forum History -> EZBoard -> YABB -> SMF 1.1.19 -> SMF 2.0.19

Advertisement: