The problem is that when you download it, the file is messed up.
Here's the code:
Code: Select all
$file_id = $_GET['file_id'];
$query = "SELECT * FROM table WHERE f_id = ".$file_id;
$result = @mysql_query($query);
while($row = mysql_fetch_array($result)) {
$type = $row['f_type'];
$file = $row['f_file'];
header('Content-type: ' . $type . '');
header('Content-Disposition: attachment; filename="' . $file . '"');
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
}Thanks for any help.