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
    Oct 17, 2022 @ 14:04
    MB
    0

    Require login to view PDF / media folder

    Hi all,

    I'm running version 9.5.0

    I have uploaded some PDF files to domain.com/media/random_folder/readme.pdf and I would like hide this file/folder behind a login.

    I have multiple PDF files uploaded in various media folders that I would like to hide behind a login.

    It can be ANY login, it doesn't have to be a Umbraco user. Just any "hardcoded" username and login.

    How can I achieve this? Does Umbraco version 9.5.0 provide any kind of locked folder feature?

    Bests, MBE

  • Markus Rytterkull 36 posts 207 karma points
    Oct 17, 2022 @ 16:21
    Markus Rytterkull
    0

    Hi,

    My first thought is that you probably have to write your own middleware that is run before the media-file is accessed, so that you can deny responses where the user is not logged in.

    But if there is simpler solution, I would be glad to hear about it :-)

    / Markus

  • Huw Reddick 1932 posts 6722 karma points MVP 2x c-trib
    Oct 17, 2022 @ 16:22
  • Owain Jones 65 posts 437 karma points MVP 4x c-trib
    Oct 17, 2022 @ 17:03
    Owain Jones
    0

    I've used the Media Protect package on a client's site in the past and it worked nicely.

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

    Note: the package does require a license.

  • 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