Issue
Is it possible to arrange file permissions/group ownership/etc in such a way that a file can be read by the function readFile()
for a forced download, but it cannot be downloaded by navigating to the literal url of the file?
Solution
Maybe you could add the user that is running apache / php to the group that owns the file. And set config to read and write for owner and owner group, and no permission at all for others. (-rwxrw---- 0r 0760)
Never tested it, but it should work.
Answered By - Gabriel Felipe Answer Checked By - Terry (WPSolving Volunteer)