Refactored the binary file request handling to allow better reuse.