protected function _getMultipartRequestFromParams($method_template, $border, $params)
  {
    $request = '';
    foreach ($params as $key => $value) {
      // is it an array?
      if (is_array($value)) {
        throw new CodebirdMediaException('Using URL-encoded parameters is not supported for uploading media.');
      }
      $request .=
        '--' . $border . "\r\n"
        . 'Content-Disposition: form-data; name="' . $key . '"';

      // check for filenames
      $data = $this->_checkForFiles($method_template, $key, $value);
      if ($data !== false) {
        $value = $data;
      }

      $request .= "\r\n\r\n" . $value . "\r\n";
    }

    return $request;
  }