= 1) { $newest = $filenames[$num - 1]; if (preg_match('/\/(\d+).bin$/', $newest, $matches)) { $server_version = $matches[1]; if ((int) $server_version > (int) $version) { $path = $newest; } } } } if ($path) { header($_SERVER["SERVER_PROTOCOL"].' 200 OK', true, 200); header('Content-Type: application/octet-stream', true); header('Content-Disposition: attachment; filename='.basename($path)); header('Content-Length: '.filesize($path), true); header('x-MD5: '.md5_file($path), true); readfile($path); } else { header($_SERVER["SERVER_PROTOCOL"].' 304 Not Modified', true, 304); } ?>