master tolong pencerahan nya... saya punya script download bgini :
download.php
<?php
$dbhost = 'localhost';
$dbuser = 'root'; // ini berlaku di xampp
$dbpass = ''; // ini berlaku di xampp
$dbname = 'buku';
// melakukan koneksi ke database
$connect = new mysqli($dbhost,$dbuser,$dbpass,$dbname);
$sql = "SELECT * FROM `tbl_valve` WHERE `id` LIKE 'A'";
$result = $connect->query($sql);
$row = $result->fetch_assoc();
//header yang menunjukkan nama file yang akan didownload
header('Content-Disposition: attachment; filename="$row[id]"');
//header("Content-Disposition: attachment; filename=".$row['id']);
//header yang menunjukkan jenis file yang akan didownload
header('Content-Type: ".$row[tipe]"');
//header yang menunjukkan ukuran file yang akan didownload
header('Content-Length: ".$row[$size]"');
$fp = fopen("valve/".$row["id"], 'r');
$content = fread($fp, filesize("valve/".$row["id"]));
fclose($fp);
echo $content;
exit;
?>
tapi saat saya jalankan muncul error bgini:
Warning: fopen(valve/A): failed to open stream: No such file or directory in C:\xampp\htdocs\perpus\download.php on line 31
Warning: filesize(): stat failed for valve/A in C:\xampp\htdocs\perpus\download.php on line 32
Warning: fread() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\perpus\download.php on line 32
Warning: fclose() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\perpus\download.php on line 33
padahal gambar sudah saya jadikan satu dalam folder, koneksi database juga sudah berhasil. mohon bantuan nya