# File lib/parts.rb, line 59
    def build_head(boundary, name, filename, type, content_len, opts = {})
      trans_encoding = opts["Content-Transfer-Encoding"] || "binary"
      content_disposition = opts["Content-Disposition"] || "form-data"

      part = ''
      part << "--#{boundary}\r\n"
      part << "Content-Disposition: #{content_disposition}; name=\"#{name.to_s}\"; filename=\"#{filename}\"\r\n"
      part << "Content-Length: #{content_len}\r\n"
      if content_id = opts["Content-ID"]
        part << "Content-ID: #{content_id}\r\n"
      end
      part << "Content-Type: #{type}\r\n"
      part << "Content-Transfer-Encoding: #{trans_encoding}\r\n"
      part << "\r\n"
    end