Protect hosted documents/pdfs/images in next.js from downloading/copying/printing #46247
Unanswered
abedshaaban
asked this question in
Help
Replies: 1 comment 3 replies
-
With a middleware ofc, where you can make sure the user is logged in or has the correct permissions. Then you can stream the file to the user. This sounds like a good read: https://hackernoon.com/nextjs-and-file-downloads-three-ways-to-restrict-access-to-a-file |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The hosted files in my public folder are not entirely protected; any user can access/ download them without restrictions. Knowing that I don't want to allow users to download my files/ pdfs. they can be accessed by clicking inspect > network > (specifically Fetch/ XHR) where the URL for the document can be shown in the Header > General > Request URL.
how can I block users from seeing that and downloading the files/ docs
thx in advanced 😄
Beta Was this translation helpful? Give feedback.
All reactions