用于下载数据库文件的代码似乎不起作用,因为下载的文件已损坏或损坏。
这是我使用的代码
if (isset($_GET['id']))
{
$id = $_GET['id'];
$query = "SELECT * FROM tbl_uploads WHERE fileid = '$id'";
$result = mysqli_query($connection,$query) or die('Error, query failed');
list($id, $file, $type, $size, $content) = mysqli_fetch_array($result);
header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: attachment; filename=".basename($file)."");
ob_clean();
flush();
$content = stripslashes($content);
echo $content;
}