I have a very similar situation to the person who asked: Can I serve MP3 files with PHP? Basically I am trying to protect mp3 files from direct download, so users have to go
Applying all these solutions, which are valid to hide the original path and filename, unfortunately doesn't prevent from unauthorized download. Indeed the client (on my case: Chrome) downloads the file.
Here the lines I put on my server:
with or without the line
header("Content-Transfer-Encoding: binary");
the final result doesn't change The directory /mp3 is located into
/home/myuser/
(thus /home/myuser/mp3) and the public HTML directory is
/home/myuser/public_html
thus calling my domain and giving
/player.php?file=music.mp3
it downloads a file called music.mp3 with all the original content.