Welcome Guest, Not a member yet? Register   Sign In
application/force-download is reported as mime-type
#1

[eluser]thisischris[/eluser]
Hi there. For some reason my upload form is getting a 'The filetype you are attempting to upload is not allowed.' validation error.

I have sorta pinpointed the error/conflict to be in the upload class.
In the 'is_allowed_filetype' function (line #585).

It gets to the end of the function and hence returns false. When I logged the reported mime-type it reports 'application/force-download'.

The file I am trying to upload is a 256kbps mp3 file.

What can I do to further investigate this error?

Thank you
#2

[eluser]thisischris[/eluser]
Calling print_r($_FILES) has the following output:
[file_mp3] => Array
(
[name] => drum loop_140bpm_noise.mp3
[type] => application/force-download
[tmp_name] => /tmp/php9QCBwh
[error] => 0
[size] => 83590
)

It works perfectly fine on my windows localhost. I have also discovered that it works via Internet Explorer but not Firefox.

So I'm guessing it's either to do with my web host or Firefox. Any suggestion would gladly be welcome. Thank you.
#3

[eluser]Aken[/eluser]
Some browsers will alter the mime type of the file being uploaded based on its own reasoning. You'll need to make sure that the mime type being supplied is associated with the file extension in the application/config/mimes.php file.
#4

[eluser]thisischris[/eluser]
Hey guys I've managed to get it working. The problem was with Firefox.

Location:C:\Users\xxx\AppData\Roaming\Mozilla\Firefox\Profiles\*********.default
It's the 'mime Types.rdf' file. It had the following in it:

Code:
<RDF:Description RDF:about="urn:mimetype:application/force-download"
                   NC:value="application/force-download"
                   NC:editable="true"
                   NC:fileExtensions="mp3"
                   NC:description="MP3 Audio File">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/force-download"/>
  </RDF:Description>

So I just changed 'mp3' to 'xyz' and it's working perfectly. I'm guessing this file got corrupt/modified somehow?

Hope someone finds this usual. Cheers

Could someone who is running firefox 11.0 see if the above entry is present in that file aswell?




Theme © iAndrew 2016 - Forum software by © MyBB