I can not upload files over 16 MB.
In /var/log/httpd/error_log i have PHP Warning: Invalid argument supplied for foreach() in /var/www/html/administrator/components/com_media/controllers/file.php on line 94 and line 131.
error_log( print_R($files,TRUE) ) logs temporary file name and etc. if file size less than 16MB, and nothing otherwise.
Joomla and PHP has file size limit at 32MB.
This occurs after ugrade to Joomla 3.4.4 from 3.3.6 through web interface updater.
Labels |
Added:
?
|
Category | ⇒ | Media Manager |
This sounds like a server issue:
Normally $_FILES is not empty (JInput retrieves this) and it is the $files array that you report empty
Joomla com_media code retrieves it and
it checks it for errors, you should get a Joomla Error message:
Exceeded PHP upload_max_filesize
Exceeded PHP post_max_size
Also test with (PHP) memory_limit
32M or 50M
In my current configuration memory_limit is 256MB. I tried 64MB and nothing changed.
On slow connection i can see that file is uploading (i wait), but nothing in media manager.
In file.php i also logs $contentLength and it is approximately equal to file size.
Today i try upload 3.5MB file and nothing happens. It is random thing (i change theme title). And i append my system information to first post.
Should i log anything else? Or enable debug mode?
Title |
|
This really sounds like a hosting issue
I am also experiencing this issue after upgrade to 3.4.4
Certain files will upload fine, but I have a zip 2.5MB zip file that will not upload.
I have added some debugging to /administrator/components/com_media/controllers/file.php and the '$files' variable is empty.
I was able to get the script to read the data by changing this variable to get the data directly from the $_FILES array, but this fails with the error 'File is too large to upload' further along in the script.
@joewebber : Try to change the code from
$files = $this->input->files->get('Filedata', '', 'array');
To
$files = $this->input->files->get('Filedata', '', 'raw');
might solve the issue. I had to make the same change in my custom extension but haven't had a chance to check why the original code doesn't work yet.
@joomdonation That works - thanks
I change 'array' to 'raw' and get "File not uploaded for security reasons", but $files is not empty.
In my media settings 'zip', 'ZIP' extensions and 'application/x-zip' mime already has been allowed. I append 'application/x-zip-compressed' - fail. Then i disable 'Restrict Uploads' and 'Check MIME Types' - fail.
Then i find post and change JFile::upload() in file.php. File uploading works now.
(In 3.4.5 version all is same)
@taur-firiath are you uploading any files with PHP code inside them? The post you found disables the security check, that is why it works for you.
files with PHP code inside
No. Images and PDFs, for example.
3.5MB PDFs NOT uploads without above hacks.
16MB images NOT uploads without above hacks.
8MB images uploads with or without hacks.
server issue
hosting issue
May be. It is my own server, not hosting. Just CentOS 7 with disabled selinux and higher PHP limits.
@taur-firiath I have uploaded the 3.5MBs you provided without a problem, first as all 6 single files at once and later as one big PDF, no issue.
The images were no problem also but it is a combination of factors. You need to have the memory_limit, post_max_size, upload_max_filesize all set large enough for the upload to handle it.
I am closing this issue as it is not an issue with Joomla. Thank you for your contribution. If you need further help on this please check with on the http://forum.joomla.org
The post you found to work around the upload restriction is just that a workaround. Joomla does scan uploaded files for possible hidden PHP code.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-11-16 11:43:35 |
Closed_By | ⇒ | roland-d |
Actually I'm facing this problem too. I have 2 zip files which contains only several pdf files, file size is about 10.xMB each.
$_FILES is not empty but $this->input->files return me empty value.
Initially I thought it was caused by file upload limit or post limit set in php.ini. It failed to upload on my localhost too where the limit already set to 128MB.
Finally I found out JFilterInput::isSafeFile return false when my zip file data (fread) contains the value in 'forbidden_extensions' which is 'php', 'phps', 'php5', 'php3', 'php4', 'inc', 'pl', 'cgi', 'fcgi', 'java', 'jar', 'py'.
Running Joomla! 3.4.8.
/libraries/joomla/filter/input.php - return false at line 552
Currently the workaround is upload the file via ftp.
@wesley-if Somewhere in the pdf files one of those words are matched. This is not a bug but a feature to safeguard from uploading malicious files.
The solution might be :
$jinput = &JFactory::getApplication()->input;
DOES NOT WORK :
$files = $jinput->files->get('jform');
WORKS :
$files = $jinput->files->get('jform', array(), 'raw');
What information should I give you?