Added binary flag for opening a file before downloading it