Correctly get binary data and set Content-Type