Replaced fixed protocol (and the previously used protocol relative paths) with a dynamic switch, so this would also work when downloading the files