core: preserve downloaded file in more cases [GH-4301]