get content-length from buffer instead of string

using string length results in truncated files.
(see http://stackoverflow.com/questions/17284408/knox-s3-upload-corrupted-or-truncated-file)