döngüde bi tuhaflık var karakter olarak aldıgı zaman sıkıntı yok ama sayı gelince kafayı yiyor :D bi göz atarmısınız

@set_time_limit(0); // disable the time limit for this script

$path = $this->fileDownloadPath;

$path = filter_var($path, FILTER_SANITIZE_URL); // Remove (more) invalid characters

$fileSize = $this->fileData->fileSize;
$fileName = $this->fileData->fileName;
$fullPath = utf8_encode($path);

if ($fd = fopen ($fullPath, "rb")) {

$path_parts = pathinfo($fullPath);
$ext = strtolower($path_parts["extension"]);


header('Content-Description: File Transfer');
header('Content-Transfer-Encoding: binary');
#header("Pragma: no-cache");
header("Content-length: $fileSize");
header('Expires: 0');
// check for IE only headers
if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) ||
(strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)) {

header('Content-Type: application/octet-stream');
header("Content-Disposition: attachment; filename=\"".$fileName.".".$ext."\"");
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {