making files in the folder donwloadable using php or javascript
<p>I am trying to making files to be downloadable after clicking the link of the listed file. I am not getting idea how to make it possible. I have completed to list file using following scripts. Now I have to provide listed file to be downloadable after clicking the file name. Plz help...</p>

<pre><code>$dir = 'd:/temp_file/voice/';
if (is_dir($dir)) {
 if ($dh = opendir($dir)) {
    while (($file = readdir($dh)) !== false) {
    if($file != '.' &amp;&amp; $file != '..')
        echo "filename: ".$file."&lt;br /&gt;";
               // header('Content-type: audio/wav');

             //   header('Content-Disposition: attachment; filename="'.$dir.$file.'"');

              //  readfile($dir.$file);
    }
    closedir($dh);
 }
}
</code></pre>
