لقد قمت بعم سكربت PHP لعمل UPLOAD AND DOWNLOAD لملفات و لكن المشكلة عند التنزيل فانه يوم بتنزيل 0 BYTES و لا أعرف لماذا
DOWNLOADCODE:
$id = $_GET['id'];
$query = "select * from downloads where download_id = $id";
$link = mysql_query($query) or die ( mysql_error() );
$res = mysql_fetch_array($link);
$type = $res['type'];
$size = $res['size'];
$path = $res['path'];
$name = $res['name'];
$no = $res['no_of_download'];
//add one to the counter
$no ++ ;
$query = "update downloads set no_of_download = $no where download_id = $id";
mysql_query($query) or die ( mysql_error() );
//start downloading
header("Content-Disposition: attachment; filename=$name");
header("Content-length: $size");
header("Content-type: $type");
readfile($path);