Hi, I have a problem now that I can not download the files I uploaded. The files appear me in a list, but when I click them nothing happens, it’s like that the variable is empty. I don’t know what i do it wrong. The code
[php]
$query = “SELECT recup_id, recup_name FROM tmp_demos”;
$result = mysql_query($query) or die(‘Error, query failed’);
if(mysql_num_rows($result)==0){
$text .= "Database is empty <br>";
}
else{
while(list($recup_id, $recup_name) = mysql_fetch_array($result)){
$text .="<a href=\"download.php?id=$recup_id\">$recup_name</a><br />";
}
}
if(isset($_GET['recup_id'])){
$recup_id = $_GET['recup_id'];
$query = "SELECT recup_name, recup_type, recup_size, recup_content FROM tmp_demos WHERE recup_id = $recup_id";
$result = mysql_query($query) or die('Error, query failed');
list($recup_name, $recup_type, $recup_size, $recup_content) = mysql_fetch_array($result);
header("Content-Disposition: attachment; filename=\"$recup_name\"");
header("Content-type: $recup_type");
header("Content-length: $recup_size");
echo $recup_content;
}
[/php]
I check with:
[php] exit($_GET[‘recup_id’]); [/php]
But the files gives me an error (i don’t know what is the error because it’s going to error_404 page). I saw if created a log file but no.
Well, i hope that someone can help me. Thank you!