Fixed bug with incorrect mime type
Why would using $filename in this context cause an issue?
Because file name that will be show in the download/open file dialog is in the $download variable and it seems logical to get mime type for it. Original file may not have extension at all (especially when download is generated from the current response [Use TRUE for the filename to send the current response as the file content])
If $filename is true it uses $download for the MIME type.
Okay, I want to give the user file named "picture.jpg", but the original file stored as md5_file($file) (without extension). What mime type should be in this case?
Ah, I see... the sent filename should match the sent mime-type.
Please create an issue and reference the pull request so that this doesn't get lost. Editing the pull request to also edit the ticket gets bonus points.
Already did :)
This commit breaks the send_file functionality.
The second argument is the download name and usually doesn't exist on the file system. For example, I might serving the file:
with the download name as:
The failure comes from File::mime; It tries to load the file to find its mime type. Line 45 of kohana/file.php. This needs to be reverted.
Fixed by e139a64.