You should not have spaces in the file name (spaces should not be used when it comes to web files)
Try something like this or rename your file without spaces:
<?php $path ='/var/www/mypath/'; $filename = 'My Cool Image.dmg'; $outfile = preg_replace('/[^a-zA-Z0-9.-]/s', '_', $filename); header('Content-Type: application/x-apple-diskimage'); // also tried octet-stream header('Content-Disposition: attachment; filename="'.$outfile.'"'); header('Content-Length: '.sprintf("%u", filesize($file))); readfile($path.$filename); //This part is using the real name with spaces so it still may not work ?>
source share