added download error handling and reporting of downloaded file size