/**
  * Prepends Content-Disposition and Content-Type headers.
  */
 public function getHeaders()
 {
     $headers = array('Content-Disposition: form-data');
     if ($name = $this->getName()) {
         $headers[0] .= sprintf('; name="%s"', $name);
     }
     if ($filename = $this->getFilename()) {
         $headers[0] .= sprintf('; filename="%s"', $filename);
     }
     if ($contentType = $this->getContentType()) {
         $headers[] = 'Content-Type: ' . $contentType;
     }
     return array_merge($headers, parent::getHeaders());
 }
Example #2
0
 /**
  * Merges cookie headers on the way out.
  */
 public function getHeaders()
 {
     return $this->mergeCookieHeaders(parent::getHeaders());
 }