This is a quick function to do a multipart upload of a file in android (and Java in general). It is adapted from Adrian Smith's code here: http://www.17od.com/2010/02/18/multipart-form-upload-on-android/.
The differences are:
- This function will not try to read the file into a string (which imposes size restrictions).
- You can pass the content type of the file upon execution
- It returns whether or not it was successful and the HTTP response code.
- It does not read the response to the upload (if you want to add it back in, the code is in Adrian Smith's page above).