Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
What is the easiest way to create protected media folder?
Child media items should be protected from not authenticated members.
I wrote a simple blog post to show you how to do it easily yourself.
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.
Thank you very much, really nice article, can you provide "ApiHelper" class also?
It's in "CodeShare.Library.Helpers" I think.
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?
This post will help you with that for v7, maybe you can get it working and share it in here after?
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?
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.
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 ?
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
Do you need a protected media folder?
Protected media items - https://codeshare.co.uk/blog/how-to-protect-media-items-in-umbraco/
there are also these two options
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:
You can work around creating actions with these parameters anchor,mode,width, height and rnd
I could easily applied Martin Carlsen's method.
merhabalar Osman Bey Türkiye'de mi umbraco development yapmaktasınız?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted