add support for download files
fixes #631