download to temporary file, rename when finished