Copied to clipboard

Flag this post as spam?

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


  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Jul 31, 2017 @ 08:51
    Alex Skrypnyk
    0

    Protected Media Folder

    Hello Community

    What is the easiest way to create protected media folder?

    Child media items should be protected from not authenticated members.

    Thanks,

    Alex

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Jul 31, 2017 @ 09:10
  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Jul 31, 2017 @ 09:26
    Paul Seal
    101

    I wrote a simple blog post to show you how to do it easily yourself.

    http://www.codeshare.co.uk/blog/how-to-protect-media-items-in-umbraco/

    It shows you how to create a simple handler for serving the media items. That handler first checks with an api call to see if the media item is protected or not. Does it have id of the protected media folder in its path?

    If it does, then check if the current user is allowed to see it.

    Hope it helps.

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Jul 31, 2017 @ 10:52
    Alex Skrypnyk
    0

    Hi Paul

    Thank you very much, really nice article, can you provide "ApiHelper" class also?

    It's in "CodeShare.Library.Helpers" I think.

    Thanks,

    Alex

  • David Knittl 13 posts 114 karma points
    Jun 05, 2019 @ 13:15
    David Knittl
    0

    Hi Paul,

    thx a lot for your blog post. I'm using it in an Umbraco v8 project and it works like a charm. The only thing I didn't find a solution for is:

    When I want to access a media file I check in the MediaHandler if the request comes from a logged in member and that check works flawlessly. But now I also want to allow backoffice users (mind you - NOT members!) to access those files. Do you have any idea how I would check, if the request comes from a logged in backoffice user in the MediaHandler?

    Cheers, David

  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Jun 05, 2019 @ 13:51
    Paul Seal
    0

    Hi David

    This post will help you with that for v7, maybe you can get it working and share it in here after?

    https://codeshare.co.uk/blog/how-to-get-the-current-logged-in-umbraco-user-and-restrict-front-end-content/

    Cheers

    Paul

  • David Knittl 13 posts 114 karma points
    Jun 07, 2019 @ 13:15
    David Knittl
    0

    Hey,

    thanks for the advice! I tried that, but ran into a problem there. The "GetUmbracoAuthTicket()" method doesn't seem to be available in v8. Do I need to reference an assembly to get access to that method? Or is it simply not available in v8?

    David

  • Paul Seal 524 posts 2890 karma points MVP 7x c-trib
    Jul 31, 2017 @ 11:14
    Paul Seal
    2

    Hi Alex Thanks I'm glad you like it and that someone might use it lol.

    I put a link to the ApiHelper class article in the post.

    Here it is again.

    http://www.codeshare.co.uk/blog/simple-web-api-helper-for-umbraco-and-mvc/

    Cheers

    Paul

  • Bhavesh Valand 3 posts 73 karma points
    Oct 26, 2018 @ 09:22
    Bhavesh Valand
    0

    Hi Paul

    Really nice article as i wanted to protect media folder and it works fine but i have found an issue when image processor module get in first and serves the image.

    example.com/media/1001/368639.jpg - is protected

    example.com/media/1001/368639.jpg?anchor=center&mode=crop&width=1600&height=500&rnd=131765692800000000 - not protected.

    Any ideal ?

    Thanks Bhavesh

  • Giacomo De Liberali 8 posts 78 karma points
    Feb 03, 2019 @ 09:19
    Giacomo De Liberali
    0

    Same here, have you found a solution?

    Edit: I wrote a little article to address the issue => https://giacomodeliberali.com/blog/umbraco-protect-media-items

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Feb 04, 2019 @ 15:27
    Alex Skrypnyk
    0

    Hi Giacomo

    Do you need a protected media folder?

    Protected media items - https://codeshare.co.uk/blog/how-to-protect-media-items-in-umbraco/

    Alex

  • Marcio Goularte 389 posts 1362 karma points
    Feb 04, 2019 @ 16:16
    Marcio Goularte
    1

    there are also these two options

    https://martincarlsen.com/securing-media-files-in-umbraco/

    https://www.steadygo.digital/blog/securing-media-files-umbraco-7-5-2/

    probably not working because the method only accepts the media url parameter. When you have more parameters, stop working (anchor,mode,width, height and rnd, etc).

    you doing it this way:

    https://martincarlsen.com/securing-media-files-in-umbraco/

    You can work around creating actions with these parameters anchor,mode,width, height and rnd

  • Osman Coskun 170 posts 404 karma points
    Jun 19, 2019 @ 21:40
    Osman Coskun
    1

    I could easily applied Martin Carlsen's method. Thanks :)

  • hakan 24 posts 118 karma points
    Jul 09, 2019 @ 11:05
    hakan
    0

    merhabalar Osman Bey Türkiye'de mi umbraco development yapmaktasınız?

  • Osman Coskun 170 posts 404 karma points
    Jul 09, 2019 @ 15:16
    Osman Coskun
    0

    Evet. Ankara'dayım.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies