out.write(("--" + multiPartBoundary + "\r\n").getBytes("UTF-8"));
out.write(("Content-Disposition: form-data; name=\"home\"; filename=\""
+ name.replace('\"', '\'') + "\"\r\n").getBytes("UTF-8"));
out.write(("Content-Type: application/octet-stream\r\n\r\n").getBytes("UTF-8"));
out.flush();
DefaultHomeOutputStream homeOut = new DefaultHomeOutputStream(out, 9, this.includeOnlyTemporaryContent);
// Write home with HomeOuputStream
homeOut.writeHome(home);
homeOut.flush();
// Post last boundary
out.write(("\r\n--" + multiPartBoundary + "--\r\n").getBytes("UTF-8"));
out.close();