caculate attachSizeBytes