Can not upload document file PDF "Error Unable to upload file" Topic is solved
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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Can not upload document file PDF "Error Unable to upload file"
Wasted a whole day trying to fix this issue and have found myself frustrated. When in an article using the Tinymce or ARKEditor to add a document link the Joomla 4 Media Manager keeps giving an error of "Error
Unable to upload file."
I have already chatted with my hosting server guy and he was not able to find any issues on the serverside of things. He did however did check the error code and here is what came back:
[Thu Jan 13 11:25:37.265838 2022] [core:error] [pid 9991:tid 47315136202496] [client 123.45.67.890:57013] Script timed out before returning headers: index.php, referer: https://[spam].com/administrator/index.php
With that information, I decided to dig deeper, and Image files upload just fine jpg or png work great, but pdf or any other document type file does not upload. I’ve checked all the normal places in the Joomla admin panels and they are normal. I really think it might be server-side somewhere that is causing this issue. What I question is in the error log it points to the Script timing out before returning headers, which tells me it’s a timing thing, but why would it affect the timing of documents and not images. This is really freaking weird.
max_execution_time :3000
memory_limit: 128M
upload_max_filesize: 86M
Any ideas on how to fix this or can anyone point me in a direction that could solve this as I have gone down now many rabbit trail directions with no avail. Thanks and I'm loving Joomla 4.
Kindest Regards,
JT
Unable to upload file."
I have already chatted with my hosting server guy and he was not able to find any issues on the serverside of things. He did however did check the error code and here is what came back:
[Thu Jan 13 11:25:37.265838 2022] [core:error] [pid 9991:tid 47315136202496] [client 123.45.67.890:57013] Script timed out before returning headers: index.php, referer: https://[spam].com/administrator/index.php
With that information, I decided to dig deeper, and Image files upload just fine jpg or png work great, but pdf or any other document type file does not upload. I’ve checked all the normal places in the Joomla admin panels and they are normal. I really think it might be server-side somewhere that is causing this issue. What I question is in the error log it points to the Script timing out before returning headers, which tells me it’s a timing thing, but why would it affect the timing of documents and not images. This is really freaking weird.
max_execution_time :3000
memory_limit: 128M
upload_max_filesize: 86M
Any ideas on how to fix this or can anyone point me in a direction that could solve this as I have gone down now many rabbit trail directions with no avail. Thanks and I'm loving Joomla 4.
Kindest Regards,
JT
- brian
- Joomla! Master
- Posts: 12474
- Joined: Fri Aug 12, 2005 7:19 am
- Location: Leeds, UK
- Contact:
Re: Can not upload document file PDF "Error Unable to upload file"
How big is the pdf?
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Re: Can not upload document file PDF "Error Unable to upload file"
136kb PDF at least I was sampling with and I tried a 19kb excel and a 51kb MS Word. None will upload, but images much bigger will.
- toivo
- Joomla! Master
- Posts: 14621
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Can not upload document file PDF "Error Unable to upload file"
The error message is displayed if the file cannot be written into a directory.
Check that the folder and Joomla temporary directory are writable from System - System Information - Folder Permissions and check the folder permissions in the server.
Check that the folder and Joomla temporary directory are writable from System - System Information - Folder Permissions and check the folder permissions in the server.
Toivo Talikka, Global Moderator
- ceford
- Joomla! Guru
- Posts: 737
- Joined: Mon Feb 24, 2014 10:38 pm
- Location: Edinburgh, Scotland
- Contact:
Re: Can not upload document file PDF "Error Unable to upload file"
What happens when you use cPanel (or similar) or FTP to upload the pdf directly to the images folder? Can you then select the pdf? Also, check the Media Options - you should see pdf in Allowed Extensions and Legal Document Extensions.
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Re: Can not upload document file PDF "Error Unable to upload file"
I can upload fine through FTP, but when I train my clients on the editor I want them to be able to do that as well clients do not know FTP stuff. They usually are tech-challenged. Once it is in there through FTP then yes a link can be created to it in the editor. PDF and other normal extensions are enabled.
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Re: Can not upload document file PDF "Error Unable to upload file"
Yes, it is marked writable and is set to 755 permissions.
- brian
- Joomla! Master
- Posts: 12474
- Joined: Fri Aug 12, 2005 7:19 am
- Location: Leeds, UK
- Contact:
Re: Can not upload document file PDF "Error Unable to upload file"
In the media manager try changing Check MIME Types to No
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
- toivo
- Joomla! Master
- Posts: 14621
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Can not upload document file PDF "Error Unable to upload file"
What is the value of post_max_size in php.ini?
What about the name of the PDF file, does it have any special characters, umlauts (äöå etc) or blank spaces?
Toivo Talikka, Global Moderator
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Re: Can not upload document file PDF "Error Unable to upload file"
@brian Ok I changed that to no and still get the "Unable to upload file." So frustrating...
@tovio the post_max_size: 256M, the name has no spaces or special characters.
I am checking and I am finding the same issue now with all my Joomla 4 sites and my Joomla 3.5. Images upload fine with no issues, but documents like PDF's are a no-go through the editor. I almost wonder if its a PHP code setting within PHP 7.3 and 7.4
@tovio the post_max_size: 256M, the name has no spaces or special characters.
I am checking and I am finding the same issue now with all my Joomla 4 sites and my Joomla 3.5. Images upload fine with no issues, but documents like PDF's are a no-go through the editor. I almost wonder if its a PHP code setting within PHP 7.3 and 7.4
- toivo
- Joomla! Master
- Posts: 14621
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Can not upload document file PDF "Error Unable to upload file"
Are the sites hosted in the same server? Does the host use mod_security or some scanning application that blocks those files? Talk to your host.
Toivo Talikka, Global Moderator
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Re: Can not upload document file PDF "Error Unable to upload file"
@toivo yes dedicated servers with the same company for the last 16 years.
- ceford
- Joomla! Guru
- Posts: 737
- Joined: Mon Feb 24, 2014 10:38 pm
- Location: Edinburgh, Scotland
- Contact:
Re: Can not upload document file PDF "Error Unable to upload file"
How long do you actually have to wait for the error message?
Debugging the Media component is tricky because the upload is handled via Javascript. However, the error message originates on line 219 of libraries/src/Helper/MediaHelper.php. It might be possible to generate a stack trace at that point but it needs to be sent to a log - I don't know how to do that.
Debugging the Media component is tricky because the upload is handled via Javascript. However, the error message originates on line 219 of libraries/src/Helper/MediaHelper.php. It might be possible to generate a stack trace at that point but it needs to be sent to a log - I don't know how to do that.
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Re: Can not upload document file PDF "Error Unable to upload file"
Message is pretty instant. The error log gives same message as the other day: [Thu Jan 13 11:25:37.265838 2022] [core:error] [pid 9991:tid 47315136202496] [client 192.63.74.104:57013] Script timed out before returning headers: index.php, referer: https://xxxxxx.com/administrator/index.php
- ceford
- Joomla! Guru
- Posts: 737
- Joined: Mon Feb 24, 2014 10:38 pm
- Location: Edinburgh, Scotland
- Contact:
Re: Can not upload document file PDF "Error Unable to upload file"
You have not said, but I assume that uploading a pdf using the Media component directly via the Content / Media menu gives the same result. Stepping through upload with a debugger I see that content plugins are triggered so I wonder what other extensions are in use.
Turns out that the Error Unable to Upload File is also triggered in plugins/filesystem/local/src/Adapter/LocalAdapter.php on line 815 - on creation of a temporary file with a name like images/61e288327715f.pdf
Turns out that the Error Unable to Upload File is also triggered in plugins/filesystem/local/src/Adapter/LocalAdapter.php on line 815 - on creation of a temporary file with a name like images/61e288327715f.pdf
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Re: Can not upload document file PDF "Error Unable to upload file"
Yes, I am using the Media component directly via the Content, the same as my client would. I came across this error in the middle of training a client on how to make document links to a PDF. I get the same error when going straight to the Media manager from the admin menu. I have not uploaded any special plugins outside of the template from Joomla51.
- toivo
- Joomla! Master
- Posts: 14621
- Joined: Thu Feb 15, 2007 5:48 am
- Location: Sydney, Australia
Re: Can not upload document file PDF "Error Unable to upload file"
Joomla 4.0.5 allows PDF files to be uploaded from Media perfectly all right. My tests using both Wampserver and remote Linux work all right. This points to the configuration of the server and/or the folder permissions.
Toivo Talikka, Global Moderator
- Per Yngve Berg
- Joomla! Master
- Posts: 28856
- Joined: Mon Oct 27, 2008 9:27 pm
- Location: Romerike, Norway
Re: Can not upload document file PDF "Error Unable to upload file"
Is the Memory Limit -1 on the server?
- brian
- Joomla! Master
- Posts: 12474
- Joined: Fri Aug 12, 2005 7:19 am
- Location: Leeds, UK
- Contact:
Re: Can not upload document file PDF "Error Unable to upload file"
"Exploited yesterday... Hacked tomorrow"
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
Blog http://brian.teeman.net/
Joomla Hidden Secrets http://hiddenjoomlasecrets.com/
-
- Joomla! Apprentice
- Posts: 11
- Joined: Thu Jan 24, 2008 5:59 pm
Re: Can not upload document file PDF "Error Unable to upload file"
You guys were right once I got to a main high-level server engineer. Here is what the issue was explained by the engineer and it made total sense and everything works better than before actually.
"First off you would make sure your Cpanel server has directives in place for its Apache MPM. In your case it's event
I found there were no apache directives"
Basically, I had no directives and I would post them and the settings here, but for obvious reasons, I will not. Hope this helps.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Thu Apr 03, 2014 12:51 am
Re: Can not upload document file PDF "Error Unable to upload file"
@revo7
I'm having the same issue on one of my servers... I know you can't publish details about your WHM setup - but can you be more specific about which directives they enabled? I have mod_mpm_worker turned on - but to no avail.
thanks!
I'm having the same issue on one of my servers... I know you can't publish details about your WHM setup - but can you be more specific about which directives they enabled? I have mod_mpm_worker turned on - but to no avail.
thanks!