Your uploading code is surely incorrect. Converting a binary blob to a utf-8 encoded string (taking Unicode as the source encoding) is definitely an incorrect approach.