I am currently working on a project that uploads audio and video files. I have no problem with the upload part. My challenge now is how to prevent streaming of the MP3 files The files are uploaded on a folder and the path to the file is stored in MySQL DB. Below is my download code.
<?php
include "db.php";
$categ="all";
$categ=$_GET['categ'];
if($categ=="all"){
$q="select * from upload_data";
}
else{
$q="select * from upload_data where CATEGORY='$categ'";
}
$result=mysql_query($q);
while($rs=mysql_fetch_array($result)){
echo "
<tr>
<td width='1%'>".$rs['FILE_ID']."</td>
<td width='20%'>".$rs['FILE_NAME']."
<br/>".$rs['FILE_SIZE']." KB
<br/><a href='".$rs['PATH']."'><button class='btn btn-primary'>Download<i class='icon-download-alt icon-white'></button></a></td>";
}
?>
Any help will be greatly appreciated.