 <p>I suspect (can't be sure till I see your <code>getMultiPartData()</code>) that you are passing to the <code>GZIPOutputStream</code> the multipart headers - things like :</p> <pre><code>writer.append("--" + boundary).append(CRLF); writer.append( "Content-Disposition: form-data; name=\"binaryFile\"; filename=\"" + file.getName() + "\"").append(CRLF); writer.append( "Content-Type: " + ((isServerGzip) ? "application/gzip" : URLConnection .guessContentTypeFromName(file.getName()))) .append(CRLF); </code></pre> <p>see <a href="http://stackoverflow.com/a/2793153/281545">here</a></p> <p>See my question <a href="http://stackoverflow.com/questions/18857271/file-corrupted-when-i-post-it-to-the-servlet-using-gzipoutputstream#18857271">here</a> for a class that manages to send the data. Notice I wrap the connection's output stream inside the GZIPOutputStream but I do not write the multipart headers in the GZIPOutputStream.</p>