Unified raw file download functionality and bugfix

David Sikter requested to merge refactor-download-file-handling into master

Fixes a common way to download raw files (#543 (closed)) and bugfix (#544 (closed))

Merge request reports