Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

General questions relating to Joomla! 3.x. Please consider the availability of third-party templates and extensions when deciding which Joomla version to use.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
jgbernard
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Apr 01, 2016 7:10 pm

Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby jgbernard » Fri May 19, 2017 5:02 pm

After upgrading to Joomla 3.7.1, I was unable to upload pdf files to my images folder. I got this message: "Illegal or invalid mime type detected". I was able to reinstall my application from a 3.7.0 backup, and I am now able to upload pdf files with this older version of Joomla. Has anyone else had this issue?

User avatar
abernyte
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3493
Joined: Fri May 15, 2009 2:01 pm
Location: Écosse - Scozia - Escocia - Škotija -स्कॉटलैंड

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby abernyte » Fri May 19, 2017 5:10 pm

It appears to be a known issue, to be fixed in 3.7.2 https://github.com/joomla/joomla-cms/pull/16091
It ain't what you don't know that gets you into trouble. It's what you know for sure that just ain't so. Twain

jgbernard
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Apr 01, 2016 7:10 pm

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby jgbernard » Fri May 19, 2017 5:14 pm

Thank you abernyte.

User avatar
mikelabadie
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Jan 29, 2008 1:55 am
Location: Frederick, MD
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby mikelabadie » Sun May 21, 2017 6:41 pm

I had the same issue. I was glad to find your post about it and the reference to it being an issue in 3.7.1 so I contacted my web host who said they were waiting for a stable version of 3.7.1. Frustrating.

However, the web host tech said to try uploading via ftp. Brilliant! No problems whatsoever.

So, while it was a minor inconvenience not to be able to upload in the Admin area, it took mere seconds to do so via ftp. I'm guessing it took you longer to reinstall 3.7.0.

User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby Ginza » Fri May 26, 2017 8:56 am

I got the same issue in Joomla 3.7.2
Coming Soon!

Mam Labs
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri May 26, 2017 11:08 am

SOLVED IT Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby Mam Labs » Fri May 26, 2017 11:19 am

For some reason in joomla 3.7.0 , 3.7.1 and 3.7.2 when you go to Global Configuration > Media > Legal MIME TYPES you may see that when it comes to pdf files it says "aaplication/pdf" (this is what i found anyway) . Remove one "a" and you are fine.

User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby Ginza » Fri May 26, 2017 11:25 am

I had the issue for Jpg image.
Coming Soon!

Mam Labs
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri May 26, 2017 11:08 am

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby Mam Labs » Sun May 28, 2017 8:39 pm

Ginza wrote:I had the issue for Jpg image.


Check if jpeg is not included in the Valid MIME Types

Mam Labs
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Fri May 26, 2017 11:08 am

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby Mam Labs » Sun May 28, 2017 9:21 pm

Ginza wrote:I had the issue for Jpg image.

Χωρίς τίτλο.png
You do not have the required permissions to view the files attached to this post.

User avatar
Ginza
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 135
Joined: Fri Oct 27, 2006 1:16 am
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby Ginza » Sun May 28, 2017 9:47 pm

I have both jpeg and jpg included in the Media settings
You do not have the required permissions to view the files attached to this post.
Coming Soon!

qclick67
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon May 29, 2017 10:09 am

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby qclick67 » Mon May 29, 2017 10:16 am

hi has there been a fix released for this issue? I have over 30 websites that are using joomla 3.7.2 and it would be great if there was something I could upload to fix this or if the fix will come out in joomla 3.7.3?

User avatar
sozzled
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3489
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby sozzled » Mon May 29, 2017 10:24 am

Are you trying to upload a .jpg, .jpeg, .Jpg, .JPG (or various other combinations of upper/lowercase file extensions)? As far as I'm aware (and I've tested this feature on a dozen or more J! 3.7.2 websites) there isn't a problem here.

This topic started with "PDF" in the subject title. Why are we now discussing JPG images? ??? :pop
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

User avatar
toivo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8746
Joined: Thu Feb 15, 2007 5:48 am
Location: Nottingham, UK
Contact:

Re: SOLVED IT Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby toivo » Mon May 29, 2017 11:31 am

Mam Labs wrote:For some reason in joomla 3.7.0 , 3.7.1 and 3.7.2 when you go to Global Configuration > Media > Legal MIME TYPES you may see that when it comes to pdf files it says "aaplication/pdf" (this is what i found anyway) . Remove one "a" and you are fine.
That is a local issue only. The option 'Legal MIME Types' has the following types in Joomla 3.7.0:

Code: Select all

image/jpeg,image/gif,image/png,image/bmp,application/x-shockwave-flash,application/msword,application/excel,application/pdf,application/powerpoint,text/plain,application/x-zip
These MIME types remain unchanged through subsequent updates to 3.7.2.
Toivo Talikka, Global Moderator
my first programs were assembled and run in 16KB :)
http://archive.computerhistory.org/resources/text/GE/GE.GE-115SystemSoftware.1967.102646096.pdf#zoom=100

AggarwalKanika
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue May 30, 2017 6:43 am

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby AggarwalKanika » Tue May 30, 2017 8:39 am

thanks for the information abernyte

loophole
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Tue Nov 14, 2006 1:32 am
Location: USA
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby loophole » Wed May 31, 2017 12:09 am

Running 3.7.2 and still receiving the mime type error when trying to upload a pdf via media manager. This is occurring on multiple sites on different hosts. Is there a fix?

User avatar
sozzled
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3489
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby sozzled » Wed May 31, 2017 12:44 am

loophole wrote:Running 3.7.2 and still receiving the mime type error when trying to upload a pdf via media manager. Is there a fix?
It depends on what's "broken".

I've tested PDF uploads (via the Media Manager) on several sites and I don't have a problem. What more can I tell you? I'm using J! 3.7.2, Isis, no changes (to what "normally" comes with Joomla) as far as the list of valid mime types is concerned, a trustworthy/reliable webhosting environment, etc. I just don't have this problem and, to put this into some context, with more than 7.2% of all Joomla sites (since the collection of usage statistics began with J! 3.5.0) now using J! 3.7.2, if the problem was widespread then we'd see a more active and concerted involvement in this topic. We simply don't have that level of engagement.

We may not be able to help you navigate a solution for this problem with the website you're currently using or because of the webhosting environment that you've chosen. In situations like these, however, my advice is to build a completely now J! 3.7.2 test site—not one of those "quick install" things, of course!—on your webhosting platform; install nothing extra and run the test upload there (i.e. attempt to upload a PDF file to the test site). If the upload attempt fails with the same error message then it's probably the webhosting platform you're using and it's not Joomla per se.
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

loophole
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Tue Nov 14, 2006 1:32 am
Location: USA
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby loophole » Wed May 31, 2017 12:57 am

We are using a dedicated server on siteground for one site and the others are on a container at PowerVPS. It occurs with both PHP 5.6 and 7. I'll try a fresh build in both environments to test and follow up here.

For reference, there is also a thread on the issue on github: https://github.com/joomla/joomla-cms/issues/16238

User avatar
sozzled
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3489
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby sozzled » Wed May 31, 2017 1:02 am

loophole wrote:For reference, there is also a thread on the issue on github: https://github.com/joomla/joomla-cms/issues/16238
The conclusion of that discussion is "most of us can't [reproduce the problem] as it looks like a server/hosting issue." I'm not saying any differently. 8)
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

User avatar
hafism
Joomla! Intern
Joomla! Intern
Posts: 97
Joined: Thu May 30, 2013 7:51 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby hafism » Wed May 31, 2017 1:19 am

Hi guys. I'm having this issue too and managed to fixed it. I'm using Joomla 3.7.2, PHP 5.6 and running on Windows IIS.

Hope this solution will help you.

1) Check in PHP extension folder if php_fileinfo.dll is available or not.
2) If it is available, enable it in php.ini by adding extension=php_fileinfo.dll
3) Save it, restart IIS and try upload the PDF again.
4) If you are running on Linux/Apache, add extension = fileinfo.so if I'm not mistaken.

Cheers!
Regards,
Hafiz
http://www.hafism.com | http://www.ibrah.hafism.com
Find me on Facebook and Twitter @feeziologi

OldGoat
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Fri Jun 19, 2015 8:24 am
Location: Boksburg, South Africa
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby OldGoat » Wed May 31, 2017 2:11 pm

What I did was:
log into cPanel
Choose "select PHP version" under "software" heading
Make sure fileinfo is checked

User avatar
mattsson
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Thu May 03, 2007 5:54 pm
Location: Cupertino, CA, USA

Re: SOLVED: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby mattsson » Wed May 31, 2017 11:47 pm

I tried the advice of upgrading to Joomla 3.7.2 and this solved the problem for me. Thank you abernyte.

User avatar
sip
Joomla! Apprentice
Joomla! Apprentice
Posts: 41
Joined: Mon Jul 09, 2007 5:34 pm

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby sip » Mon Jun 12, 2017 3:10 pm

OldGoat wrote:What I did was:
log into cPanel
Choose "select PHP version" under "software" heading
Make sure fileinfo is checked


Thanks OldGoat...that solved it for me.

I've been moving sites over from PHP 5.6 to 7.1 and that setting isn't on by default. 8)

kentmorrison
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Sun Jan 18, 2009 8:18 pm

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby kentmorrison » Thu Jun 15, 2017 2:54 pm

Joomla 3.7.0 with PHP fileinfo NOT enabled - upload of .PDF worked
Joomla 3.7.1 with no change to PHP fileinfo - upload of .PDF QUIT WORKING
Joomla 3.7.2 with no change tto PHP fileinfo - STILL CANNOT UPLOAD .PDF
THEN had web host techs ADD fileinfo to PHP - NOW we can upload .PDF files again.
...just another loose end that wasted hours and hours of productivity.

andrewwoo
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Aug 12, 2015 5:33 pm

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby andrewwoo » Mon Jul 10, 2017 1:22 pm

OldGoat wrote:What I did was:
log into cPanel
Choose "select PHP version" under "software" heading
Make sure fileinfo is checked


Thanks OldGoat - worked for me too!

i4m_woot
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Jul 07, 2015 5:32 pm

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby i4m_woot » Fri Jul 14, 2017 7:26 am

OldGoat wrote:What I did was:
log into cPanel
Choose "select PHP version" under "software" heading
Make sure fileinfo is checked


Yep thanks, worked for me too :D

mercury
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Thu Feb 13, 2014 1:44 am

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby mercury » Fri Jul 14, 2017 10:54 am

For what it is worth and whilst it does not necessarily address the problem as outlined, if you are using the paid version of JCE Pro the file/edit button allows you to upload a pdf without any dramas while we wait for the experts to correct this particular anomaly! Cheers.... Rod

Starhorsepax
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Mon Nov 14, 2011 2:54 pm

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby Starhorsepax » Tue Jul 25, 2017 3:13 pm

I am having this exact problem and its a serious issue. The client needs to upload multiple pdf forms. It is definitely not the host. We moved it to the development sub folder on our site.

So our root live site was upgraded from Joomla 2.5 to 3.7 + in exactly the same way and the PDF upload works fine. All the settings are the same.

The client site in the subfolder gives invalid mime type. It doesn't even help to upload via FTP (something the client is unlikely to do when they get it back) because the file in the media manager even when FTP says its there and I can re-download it or put the absolute url in web browser and go to it. It does not show in the WYSIWIG editor. It will not upload via Media Manager or the Editor.

This site is using Joomla 3.7.3 so something is wrong. If its not the host, not the settings and the uploads worked fine pre-update then what is left? I need a fix for this.

User avatar
sozzled
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3489
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia
Contact:

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby sozzled » Wed Jul 26, 2017 8:27 pm

@Starhorsepax: Did you see this?
sip wrote:
OldGoat wrote:What I did was:
log into cPanel
Choose "select PHP version" under "software" heading
Make sure fileinfo is checked

Thanks OldGoat...that solved it for me.

I've been moving sites over from PHP 5.6 to 7.1 and that setting isn't on by default. 8)
https://www.kuneze.com/blog
Former member of Kunena project team
If you think I’m wrong then say “I think you're wrong.” If you say “You’re wrong!”, how do you know?

User avatar
mattsson
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Thu May 03, 2007 5:54 pm
Location: Cupertino, CA, USA

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby mattsson » Wed Aug 16, 2017 12:26 am

OldGoat's fix worked for me too! Thank you OldGoat, i4m_woot and sozzled.

Details: My site is at Joomla 3.7.4 and the PDF upload error was still occurring for me. A clue was, the development site is hosted at SiteGround, I could upload my PDF there. The live site, where I checked the PHP "fileinfo" box to make the fix, is hosted at Rochen.

DarKMaSk
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Thu Jul 19, 2012 6:13 pm

Re: Illegal or invalid mime type detected when trying to upload pdf after 3.7.1 upgrade

Postby DarKMaSk » Thu Aug 31, 2017 9:48 am

OldGoat wrote:What I did was:
log into cPanel
Choose "select PHP version" under "software" heading
Make sure fileinfo is checked


Yes!!! This is the solution. Thanks mate for the knowledge. :)


Return to “General Questions/New to Joomla! 3.x”

Who is online

Users browsing this forum: effrit, gws, iry0502, jm_joomla, jonBuckner1 and 16 guests