Put audio file to download and listen in php

0

I have some audios on my server and I want to put them online so that it is possible for the client side to have access both to listen and to download. I'm working with php and a linux server, a debian version.

<td> 
        <audio controls="controls">
             <source src="teste.mp3" type="audio/mp3" />
         </audio>
  </td>

This is an example found on the internet, but when I put the path of my file I can not access it, either to download or listen.

So what's the best way to be able to download and listen online to a wav file from my server in an online application?

    
asked by anonymous 27.07.2017 / 23:35

1 answer

0
<td> 
<audio controls="controls">
<source src="teste.mp3" type="audio/mp3" />
</audio>
</td>
<br />
<a href='forcardownload.php?arquivo=teste.mp3'>Baixar MP3</a>

Read how to create a script for downloading files: HERE

  

Note: Be aware of security issues in the text of the link you provided.

    
27.07.2017 / 23:52