Hello,
Yesterday I've left a message what says that I've a problem with downloading.
In stead the real problem is the file is opening instead of downloading.
I've execly the same problem like there
http://www.phpbuilder.com/board/sho...readid=10241922
The suggestion is to include a header like ;
@header("Content-Type: application/pdf"); //sets type
@header("Content-Disposition: attachment; filename=$name"); //gets filename
@header("Content-Description: Download File"); // describes what you are doing
@readfile($name);
I've tried to include this in my script but that doesn't work.
It can be also a problem because the headers are in a while boucel.
Here is the part of my script:
while ($row = mysql_fetch_array($Resultat1,MYSQL_ASSOC))
{
print("<TR>
<TD>{$row["id_titre"]}</TD><TD>{$row["titre"]} </TD><TD>{$row["nom"]}</TD>
<TD>{$row["titrealbum"]}</TD><TD>{$row["numalbum"]}</TD><TD>{$row["genre"]}</TD>
<TD>{$row["maisondisque"]}</TD><TD>{$row["nationalite"]}</TD><TD>{$row["langue"]}</TD>
<TD>{$row["annee"]}</TD><TD>{$row["duree"]}</TD><TD>{$row["sexe"]}</TD>
<TD>{$row["tempo"]}</TD><TD>{$row["nomdescription"]}</TD>
<TD><a href='{$row["chemin"]}'>
<p align='center'><img border='0' src='NoteMusique.gif' width='13' height='16'></p></a>
</TD>
<TD>
<a href='{$row["chemin"]}'>
@header("Content-Type: application/wav");
@header("Content-Disposition: attachment; filename=$row["chemin"]");
@header("Content-Description: Download File");
@readfile($row["chemin"]);
<p align='center'><img border='0' src='downloads.jpg' width='30' height='35'></p></a>
</TD>
</TR>\n");
I don't know realy how to use headers.
I don't think it's the right way.
Anybody can explane me?
Thank you.