Allow downloading 0-length files if they have a name

Resolves I#9050
Merge branch '4.2/download-0-length-files' into 4.2-trunk