0
I would like to protect audio files in a public apache directory.
I don’t necessarily intend to download the file (I saw several tips about) and play it in the browser only for users who have active session.
I’ve already changed the .htaccess
not to list the directory files, but they are still accessed directly by the URL without being logged in.
<audio controls>
<source src="/audios/audio.wav" type="audio/wav">
</audio>
The only trick I imagined was putting the files in the directory /home/user/audios
, for example, and when the user wants to listen, copy the audio to the public folder and play it. You would also need a routine to delete the files periodically.
I wish I could get a second opinion.
Grateful from now on.
PS. I am using PHP.