Welcome Guest, Not a member yet? Register   Sign In
Mime Type errors for upload library
#1

I'm getting an error stating that the "type is not allowed", but I've tried both the file extension and the mime types separated by pipes.  

I'm attempting to allow uploads of .odt, .ods, .odp, .docx, .xls, txt, zip, and  .pdf files.

Code:
$config['allowed_types'] = 'application/vnd.oasis.opendocument.spreadsheet | application/vnd.oasis.opendocument.text | application/vnd.oasis.opendocument.presentation | application/vnd.openxmlformats-officedocument.wordprocessingml.document | application/vnd.ms-excel | application/vnd.openxmlformats-officedocument.presentationml.presentation | zip | txt | application/pdf';

Here is where I got the MIME types for the LibreOffice files.

Any ideas?
Reply
#2

Did you try not using spaces between the pipe separated types? (type1|type2|type3) vs (type1 | type2 | type3)
Reply
#3

(This post was last modified: 02-12-2015, 11:25 AM by bmarker.)

Nope doesn't work, I actually tried the spaces second. Could it be a server issue?

I've added the MIME types to config->mimes.php, still doesn't work...
Reply
#4

Not happy with the solution, but I used.
$config['allowed_types'] = '*';
to allow all
Reply
#5

For troubleshooting, I'd try a single mimetype at a time. Upload a file with that mimetype and if it works, add the next one separated by a pipe and retry the upload with that new filetype. Keep going until it breaks.

I've never tried to put mimetypes directly in the $config['allowed_types'] and have always used a piped delimeter of extensions (pdf|jpg|gif), with the corresponding mimetypes in the /config/mimes.php config file. According to the docs, you should be able to use the mimetypes directly in the $config['allowed_types'], but I've never tried.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB