Trying to get the entire file downloaded -- but I assume the script is exiting with the first chunksize pass in the stream.
What needs to be coded in to get full file size download?
$image_link=$_GET['image_link'];
$fullPathDL=$path0.$image_link;
$fsize = filesize($fullPathDL);
$path_parts = pathinfo($fullPathDL);
if ($fd = fopen($fullPathDL, "rb")) {
$fsize = filesize($fullPathDL);
header("Content-type: application/jpg"); // add here more headers for diff. extensions
header("Content-Disposition: attachment; filename=\"".$path_parts["basename"]."\""); // use 'attachment' to force a download
header("Content-length: $fsize");
// header("Cache-control: private"); //use this to open files directly
while(!feof($fd)) {
$buffer = fread($fd, 8192);
echo $buffer;
}
fclose ($fd);
exit;
}