There is some code in the forum that builds such a request for uploads. You will need to write something similar that parses the response and builds the file.
How to parse such response, if, for example, binary file part is very big (5-25 MB APK to be later installed)?
I have to find boundary start and finish...