/** * Implements hook_file_download(). */ function {{ machine_name }}_file_download($uri) { // Check to see if this is a config download. $scheme = StreamWrapperManager::getScheme($uri); $target = StreamWrapperManager::getTarget($uri); if ($scheme == 'temporary' && $target == 'config.tar.gz') { return [ 'Content-disposition' => 'attachment; filename="config.tar.gz"', ]; } }