Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Aximili 177 posts 275 karma points
    Sep 05, 2011 @ 07:48
    Aximili
    0

    How to find unused files under the media folder?

    I have been copying files back and forth from my computer to the server. I realised this copies some images in the media folder that are not actually use

  • Matt Brailsford 1886 posts 9249 karma points MVP 5x c-trib
    Sep 05, 2011 @ 13:28
    Matt Brailsford
    0

    Hi Hardi,

    You might want to take a look at the Umbraco Pro product - Concierge which is capable of showing dependencies on files so you can tell if it's safe to delete a file or not.

    Cheers

    Matt

  • Aximili 177 posts 275 karma points
    Sep 06, 2011 @ 02:04
    Aximili
    0

    Thanks Matt. Would you know how to do it manually? I'm a developer, I'd like to know the database. Or is there some kind of documentation for the database?

  • Aximili 177 posts 275 karma points
    Sep 06, 2011 @ 02:22
    Aximili
    0

    I found it! http://blog.hendyracher.co.uk/umbraco-database-part-1/

    To find all the files that are being used:

    SELECT contentNodeId, alias, dataNvarchar AS umbracoFilename
    FROM cmsPropertyData
    INNER JOIN cmsPropertyType ON cmsPropertyData.propertytypeid = cmsPropertyType.id
    WHERE cmsPropertyType.dataTypeId = -90

    Now I know, to clean up unused files, you scan for all files under the media folder that are not found in the result above. :)

  • Fernando Camillo 40 posts 81 karma points
    Jun 18, 2013 @ 20:13
    Fernando Camillo
    0

    Hello, I've made a script with Visual Studio to check for unregistered media files. Hope it helps.

    http://our.umbraco.org/forum/using/ui-questions/36656-Delete-unused-media-items?p=0#comment152733

  • Michele Di Maria 27 posts 199 karma points
    Jan 02, 2018 @ 07:13
    Michele Di Maria
    0

    Hello, take a look at this: https://our.umbraco.org/projects/backoffice-extensions/mediacleaner/

    it is compatible with all the database types and integrated in the Umbraco Backoffice.

    Thanks, Michele

  • Tim Murphy 7 posts 76 karma points
    1 week ago
    Tim Murphy
    0

    Hi Michele,

    This extension looks good, but using 7.10.2 I can't get it to complete a scan without timing out -- admittedly I'm attempting to clean-up almost 6000 media items. Can you extend the timeout period?

    Cheers,

    Tim

Please Sign in or register to post replies

Write your reply to:

Draft