I am trying to make a website which support mp3 downloading. I don't have any idea with this. I just tried like uploading image , in that I can store mp3 files into database and from there I can move that file into specified folder. I don't know here I am using correct method or not. Now I want to make downloadable mp3 file by clicking a link.Please guide me to complete this.
Thanx in advance.
Below I am pasting my code...
<?php
include ("config.php");
?>
<html>
<head>
<body>
<form name="song" action="" method="post" enctype="multipart/form-data">
Upload MP3:<input type="file" name="mp3" id="mp3"><br/>
<input type="submit" name="btnsubmit" value="Submit">
</form>
<?php
$select=mysql_query("select * from mp3_file")or die(mysql_error());
$result=mysql_result($select,0,'song');
if(isset($_POST["btnsubmit"]))
{
$file_name =$_FILES['mp3']['name'];
$temp = $_FILES['mp3']['tmp_name'];
$insertion=mysql_query("insert into mp3_file values('','$file_name')")or die(mysql_error());
if($insertion)
{
move_uploaded_file($temp,$file_name);
}
}
?>
</body>
</head>
</html>