Copied to clipboard

Flag this post as spam?

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


  • Rihab 104 posts 388 karma points
    Jul 23, 2020 @ 11:31
    Rihab
    0

    sort media by size

    Hi Everyone,

    I am working with Umbraco 7.15.5 and searching for a way to know what are the "heaviest" media (pictures) of my site.

    And I would like to be able to list all the media from that folder, sorted descending by size. Is there any way to do so?

    thanks.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 23, 2020 @ 15:13
    Ismail Mayat
    0

    Do you want this list on the frontend or in the Umbraco backend as a dashboard?

  • Rihab 104 posts 388 karma points
    Jul 23, 2020 @ 15:19
    Rihab
    0

    Hi Ismail

    I need it to be in the backoffice, in the media section would be better.

    Thanks.

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 23, 2020 @ 15:25
    Ismail Mayat
    0

    You can build your own dashboard control using angular, I would take a look at some existing ones to see how todo that. A good example https://github.com/enkelmedia/TheDashboard/tree/V1.4.0

    You will need to create endpoint to give you back results of media. That endpoint can do an examine search on internal index.

    The internal index stores meta information about media including umbracoBytes you can sort on that. Alternatively the end point could use the MediaService and you can get folder and then list its content and sort on umbracoFile. The examine way will be more performant that MediaService.

Please Sign in or register to post replies

Write your reply to:

Draft