1

I'm doing the file uploading with the HttpUrlConnection class.

conn.setRequestMethod("PUT");
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setRequestProperty("Trailer", "Content-Integrity");              
conn.setFixedLengthStreamingMode((int) (getSourceSize()-pos));

while ((bytes = in.read(block, 0, DEFAULT_BLOCK_SIZE)) > 0) {
        out.write(block, 0, bytes);
}

And after that I need to send the Content-Integrity header like: Content-Integrity: sha-256:bdcf7f645fd53dd3b3763f59376134ff58cc337247c978bdd178b6ccdfbff19f

How can I do this?

Jacob Schoen
  • 14,034
  • 15
  • 82
  • 102
Alexandr
  • 474
  • 7
  • 13
  • My answer presumed you were trying to do something different. See here: http://stackoverflow.com/questions/7851645/how-do-i-send-http-trailers-footers-in-a-chunked-response-from-within-a-java-ser – Perception Nov 16 '12 at 17:17

1 Answers1

0

Generally HTTP/TCP will already ensure that the data was reassembled correctly, if you are worried about data security than SSL (or other for of encryption) will be better.

Germann Arlington
  • 3,315
  • 2
  • 17
  • 19