Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8614347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:06:03+00:00 2026-06-12T05:06:03+00:00

For some reason when using $this->response->send_file($file_to_send, $file->hashed_name.’.’.$file->extension); I get errors like this: ErrorException [

  • 0

For some reason when using

$this->response->send_file($file_to_send, $file->hashed_name.'.'.$file->extension);

I get errors like this:

ErrorException [ Warning ]: mime_content_type() [<a href='function.mime-content-type'>function.mime-content-type</a>]: can only process string or stream arguments

SYSPATH/classes/kohana/file.php [ 52 ]

47      }
48 
49      if (ini_get('mime_magic.magicfile') AND function_exists('mime_content_type'))
50      {
51          // The mime_content_type function is only useful with a magic file
52          return mime_content_type($filename);
53      }

Trace shows that mime_content_type(arguments) seems to be bool FALSE for some reason.
However I pass to send_file normal string full path like /var/www/dev3/media_files/files/113b778d9751e7d1667b300557b6e8030ba1227e68ef9c4dd093a4cd79691f9d.png.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:06:04+00:00Added an answer on June 12, 2026 at 5:06 am

    I’ve checked Kohana system files and it turned out that I can pass mime_type manualy as an option, so this works perfectly:

    $this->response->send_file($file_to_send, $file->name.'.'.$file->extension, array('mime_type' => File::mime_by_ext($file->extension)));
    

    However, standard $this->response->send_file($file_to_send) does not work for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Relatively new to using database and for some reason I can't get this 'execute'
For some reason when I generate this using jquery to fill in my table.
Im using oslib with the pspsdk toolchain and for some reason this doesnt work
I'm using reCaptcha in this form I build, but for some reason, it loses
I'm using curl to do post request, for some reason it prints xml response,
I'm using org.apache.commons.httpclient.HttpClient and need to setup response encoding (for some reason server returns
I just installed FuzzyFinder for gvim, though for some reason it's using an ultra
For some reason, Vim keeps using soft-tabs (tabs as spaces) everytime I'm working on
I'm using selenium with IE 7,8,9 and for some reason, some CSS 3 locators
I am using Visual studio 2008 and for some reason when I started today

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.