Fix download on Linux if filepath contains directory

This change fixes a problem on Linux with downloading files.

On Linux we shouldn't replace forward slashes with backslashes because the forward slash serves as directory separator.