I\'m developing a new website with PHP & MySQL.
The website is for an online eBook library that grant access to its books based on paid subscription plans.
S
You'll be able lock down the files from unwanted downloads. But redistribution or sharing login details will be a battle.
Some options I can think of
Option 1: You can handle this yourself on the server. Housing the PDFs outside of the public Apache directory (so there is no way a URL can reach it). Then with a PHP function read the contents of the file and stream it to the browser. Streaming a large file using PHP
Option 2: Use something like AWS S3. You can lock down the bucket so there is no public access. And generate signed URLs as needed. They'll be unique urls which you can specify a time limit of availablity. AWS S3 The security of a signed URL as a hyperlink