-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to upload PDF files in Media library #42105
Comments
Under Media, select one of these PDFs and click the This is better posted @ https://forum.joomla.org/ as it appears to be a support question specific to your setup. |
The file is listed as Mime Type: "application/pdf" and extension: "pdf" pdf is configured as a legal document extension, and application/pdf is configured as a legal mime type. |
I am not able to reproduce it with v4.3.4. Maybe you can test with a separate clean installation using the latest version. |
|
Can you please share your media manager options? I suspect that you've followed some wrong tutorial or you have some plugin that is really bad (assigns pdf to images)... |
@brianteeman The error states that the file uploaded is not a valid image, Fileinfo Available displays Yes. @dgrammatiko
Forbidden MIME-types: text/html |
I am not sure if this is relevant here. I cannot upload pdfs. I have a very similar problem with [https://forum.joomla.org/viewtopic.php?t=1002182] |
Closing as having a pull request. See #43345 . |
PHP version: 8.2.6
Joomla version: 4.2.8
After upgrading to Joomla 4.2 (a while ago) I've gotten complaints from users that they are unable to upload PDF files in the Media library.
Upon some investigation it turns out that Joomla assumes that any file a user uploads is an image, and fails to get the Mime Type for the uploaded file, as it's not an image.
Upon investigation it turns out that this line of code is causing the issue:
joomla-cms/libraries/src/Helper/MediaHelper.php
Line 277 in c4e13bc
The whitelist a bit above that line will also cause Joomla to think that document files are images:
joomla-cms/libraries/src/Helper/MediaHelper.php
Line 271 in c4e13bc
I have to admit that I'm not familiar enough to know if this is a mistake on my part, but changing line 277 to the following resolved my issue:
The text was updated successfully, but these errors were encountered: