title: Kohana 3.2 Response::send_file seems broken to me
body: <p>I'm trying to send a file to the browser to download, and not having a luck using <code>$this-&gt;response-&gt;send_file($file_path);</code> in the controller.</p>
  
  <p>I get the following error:</p>
  
  <p><code>ErrorException [ Warning ]: finfo::file() [&lt;a href='finfo.file'&gt;finfo.file&lt;/a&gt;]: Empty filename or path</code></p>
  
  <p>$file_path can be either absolute or relative path, but I still get the same error. After looking at the Kohana code for this implementation I just can't figure out how this should work.</p>
  
  <p>The following code will shows how a base filename (eg, filename.ext) is passed into File::mime() - which is wrong</p>
  
  <p><a href="https://github.com/kohana/core/blob/3.2/develop/classes/kohana/response.php#L434-453" rel="nofollow">https://github.com/kohana/core/blob/3.2/develop/classes/kohana/response.php#L434-453</a></p>
  
  <pre class="lang-php prettyprint-override"><code>// Get the complete file path
  $filename = realpath($filename);
  
  if (empty($download))
  {
      // Use the file name as the download file name
      $download = pathinfo($filename, PATHINFO_BASENAME);
  }
  
  // Get the file size
  $size = filesize($filename);
  
  if ( ! isset($mime))
  {
      // Get the mime type
      // HERE'S THE ISSUE!!!
      $mime = File::mime($download);
  }
  </code></pre>
  
  <p><a href="https://github.com/kohana/core/blob/3.2/develop/classes/kohana/file.php#L24" rel="nofollow">File::mime</a> expects the filepath to be absolute or relative path on the filesystem, but $download will only ever be a  base filename (eg filename.ext);</p>
  
  <p>The only solution that works for me right now is to change the code in the send_file() method 'classes/kohana/response.php' </p>
  
  <p>from <code>File::mime($download);</code> 
  to <code>$mime = File::mime($filename);</code>.</p>
  
  <p>Kohana 3.3 has changed this implementation to:</p>
  
  <p><code>$mime = File::mime_by_ext(pathinfo($download, PATHINFO_EXTENSION));</code></p>
  
  <p>Essentially send_file does not work in 3.2 without this fix. Is this a bug, or what am I missing here?</p>