Fix the logic of reading binary file

Current it can not work on windows
Merge pull request #93 from zhaoguoyuan/bugfix/failed_to_upload_image_on_win

Fix the logic of reading binary file