Some templates contain different download URIs that end with the same file name.
For example the Docker command-line client template lists:
https://download.docker.com/linux/static/{channel}/x86_64/docker-{version-original}.tgz
https://download.docker.com/mac/static/{channel}/x86_64/docker-{version-original}.tgz
0template will download the first and then (incorrectly) assume the second file is the same.
Perhaps the local file name should be the entire download URI in url-encoded form, rather than just the file name part?