Advertisement:

Author Topic: Check which attachment files are not used  (Read 4251 times)

Offline X3mE

  • Full Member
  • ***
  • Posts: 476
  • Gender: Male
  • The more I C, the less I see.
    • Lolmao.info - The site that makes you laugh!
Check which attachment files are not used
« on: October 29, 2008, 09:31:19 PM »
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



Offline N3RVE

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,907
  • Gender: Male
    • N3RVE.COM
Re: Check which attachment files are not used
« Reply #1 on: November 01, 2008, 06:54:31 AM »
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

Offline X3mE

  • Full Member
  • ***
  • Posts: 476
  • Gender: Male
  • The more I C, the less I see.
    • Lolmao.info - The site that makes you laugh!
Re: Check which attachment files are not used
« Reply #2 on: November 01, 2008, 09:03:26 AM »
Thank you, I hope you'll find a solution :)
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



Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,806
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Check which attachment files are not used
« Reply #3 on: November 10, 2008, 05:30:34 AM »
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 ]

Offline X3mE

  • Full Member
  • ***
  • Posts: 476
  • Gender: Male
  • The more I C, the less I see.
    • Lolmao.info - The site that makes you laugh!
Re: Check which attachment files are not used
« Reply #4 on: November 10, 2008, 08:55:46 AM »
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



Offline Rumbaar

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,806
  • Gender: Male
  • Inherent Omniscience
    • Rumbaar.net
Re: Check which attachment files are not used
« Reply #5 on: November 10, 2008, 03:40:36 PM »
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 ]