I have a website which is a few years old now, it basically offers downloads.
Anyway since moving server people can not download files because its now giving a error
The problem is in
header('Content-Length: ' . filesize($file) + 1);
Dot is evaluated before plus so your code is string + 1, result is 1 and this causes that 1 is sent as header. Correct code should be
header('Content-Length: ' . filesize($file));
because according to this page http://www.php.net/manual/en/function.readfile.php no +1 is used. Other solution is
header('Content-Length: ' . (filesize($file) + 1));
which will work as you want.