Copied to clipboard

Flag this post as spam?

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


  • MB 273 posts 936 karma points
    Jul 17, 2022 @ 15:14
    MB
    0

    Restrict public access to files

    Dear community,

    I have "restrict public access" on specific pages on my website. In these pages I link to various files that require membership login.

    However, these files can be accessed without being logged in if you have the URL.

    Is it possible to restrict public access to files somehow?

  • SteveV 54 posts 240 karma points
    Jul 17, 2022 @ 16:27
    SteveV
    100

    At the moment it's not a standard feature of Umbraco but there is a commercial plugin available that does the job.

    https://our.umbraco.com/packages/website-utilities/media-protect/

  • MB 273 posts 936 karma points
    Jul 17, 2022 @ 16:42
    MB
    0

    Thanks for the reply SteveV!

  • Jamie Attwood 207 posts 501 karma points c-trib
    Nov 22, 2022 @ 18:26
    Jamie Attwood
    1

    I have built a custom middleware that does what you are looking for using 9/10. Here is the post - scroll to the bottom for the most robust part of the solution.

    https://our.umbraco.com/forum/using-umbraco-and-getting-started/108979-intercept-all-media-requests

  • MB 273 posts 936 karma points
    Dec 26, 2022 @ 17:25
    MB
    0

    Jamie, this is EXACTLY what I needed! I changed the close slightly to see if the URL contains .PDF and it works beautifully.

    Thank you so much for coming by this thread and taking your time to provide an aswer, kudos to you.

    Have a wonderful day and thank you!

  • Jamie Attwood 207 posts 501 karma points c-trib
    Dec 28, 2022 @ 22:52
    Jamie Attwood
    0

    That's great. Really happy to hear that. I do think that you might also have all your umbraco back office users unable to access those PDFs too unless they are logged in to the front-end as a member as well at the same time they are logged into the back-office. If so, there is some extra code we can add that will allow a back office user to see all media as well without restriction.

    If you could mark the above as the 'solution' that would be awesome.

    Cheers,

    Jamie

Please Sign in or register to post replies

Write your reply to:

Draft