Check which attachment files are not used

Started by X3mE, October 29, 2008, 09:31:19 PM

Previous topic - Next topic

X3mE

Is there a way for me to check which files in the attachments folder are not used as attachments?
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



N3RVE

Hello, X3mE :)
I couldn't find a way to remove attachments that aren't linked with posts but I will be looking more into this shortly. Currently, you can perform maintenance to remove old attachments and/or attachments larger than a specified size.
Admin CP -> Forum -> Attachments and Avatars -> File maintenance.

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

X3mE

Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



Rumbaar

Well all things being equal there shouldn't be any orphan files.  As once you delete them they are deleted from the folder.

As the database holds what is in use, there is no real way to check the other way.  I know there was a post I responded too many months ago with the same question and a few ideas and limits to what was possible.  Due to the nature of attachment storage and 'encryption' of filenames.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

X3mE

Let me explain what happened... I have switched to a new server, and uploaded everything but the attachments folder (as they take a lot of space, and my upload speed is slow), and then, while uploading them, one of the users didn't see my note about attachments not working currently, and reuploaded a few he posted earlier. So, when the upload had finished, I practically had a few "double" files, that is a few files not used as attachments. They are only a couple of MB big, nothing to worry about, I just asked if there's a sophisticated way to check which files in that folder are not used.
Kids, you tried your best and you failed miserably. The lesson is - never try.

My mods:
OS & Browser Detection (1.5 is out!) | Skype Profile Field | GTalk Profile Field | AllCaps Blocker | SMF Syntax Highlighter (Beta) + 2 in development!

Personal websites:
Mobilize.rs (and forum) | Lolmao.info



Rumbaar

Not that I'm aware of sorry, a very manual process and possibly impossible if you have filename encryption on.  Maybe guess work and date/timestamp checking.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: