Added the download flag to checkout, so that it can redirect to stat.php to trigger a download of metadata file.