Do not attempt to send data using anything approaching the text API. You did not say what postData , but try to find some part of your API that deals with binary data streams instead of text data. Searches for methods in the AppendBytes or GetStream strings to get a stream to which you can write your data.
Pretending that arbitrary binary data is text is a bad idea - you will lose data.
EDIT: One way that does not lose data (but is still bad) is to process binary data as an ISO-8859-1-encoded document. IIRC has some debate about what exactly ISO-8859-1 contains in provisions 128-159, but most encodings, at least, assume Unicode 128-159.
Your “UTF-8 decoding” of binary data may look like valid data, because for values 0-127 they are the same — it is only above that you will have problems. However, you should still avoid processing this binary data as text. This is not a text, but viewing it as a text is just a recipe for disaster.
If you can publish the headers sent by your browser (including the headings of the part of the multipart corresponding to the image), we can hope to help you a little further, but in the end you should find a way to pass any API that you use (this is also useful information), raw binary data without going through the text.
source share