I'm really not sure what the point of setting it to application/octetstream is. According to RFC2045 (http://tools.ietf.org/html/rfc2045#section-6.4), any unknown content should have the mimetype application/octet-stream. There is no application/octetstream mentioned anywhere. I have now changed the code to default to application/octet-stream if no mimetype is set.