Reputation: 6353
When trying to upload an XML file in Codeigniter. I am working with eFax, trying to set up Inbound Fax Delivery: Enabling XML Posting. I am getting the following error anytime I do a test post using their Sample.xml file they have provided:
The filetype you are attempting to upload is not allowed.
Other documents will upload fine. In my upload config, xml
is set in the options for allowed_types
:
$config['allowed_types'] = 'txt|xml';
Why does Codeigniter not allow the eFax XML document type?
Upvotes: 2
Views: 2475
Reputation: 53
this is the one I use:
'xml' => array('application/xml', 'text/xml', 'text/plain'),
NOTE: paste it in /application/config/mimes.php
Upvotes: 0
Reputation: 6353
I've figured out why this was happening. By default, the MIME type was not set in Codeigniter's mimes.php
config file. I needed to add an array of multiple MIME types for the xml
MIME. Specifically, I needed to add application/xml
.
So in /application/config/mimes.php
I changed this line:
'xml' => 'text/xml',
To this (converting the xml
option to an array):
'xml' => array('text/xml', 'application/xml'),
That fixed the problem right away.
Upvotes: 6