?
avatar taur-firiath
taur-firiath
11 Oct 2015

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.

Joomla system information

avatar taur-firiath taur-firiath - open - 11 Oct 2015
avatar zero-24 zero-24 - change - 11 Oct 2015
Labels Added: ?
avatar zero-24 zero-24 - change - 11 Oct 2015
Category Media Manager
avatar taur-firiath
taur-firiath - comment - 13 Oct 2015

What information should I give you?

avatar ggppdk
ggppdk - comment - 20 Oct 2015

This sounds like a server issue:

  • maybe related to your PHP version / web server version
  • maybe not enough disk space (not in your case)

Normally $_FILES is not empty (JInput retrieves this) and it is the $files array that you report empty

  • it is not empty even if file-size limits are exceeded

Joomla com_media code retrieves it and
it checks it for errors, you should get a Joomla Error message:

Exceeded PHP upload_max_filesize

  • This file is too large to upload.

Exceeded PHP post_max_size

  • Total size of upload exceeds the limit
avatar ggppdk
ggppdk - comment - 21 Oct 2015

Also test with (PHP) memory_limit

32M or 50M

avatar taur-firiath
taur-firiath - comment - 21 Oct 2015

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?

avatar taur-firiath taur-firiath - change - 21 Oct 2015
Title
Media manager not upload "large" files
Media manager not upload some files
avatar brianteeman
brianteeman - comment - 21 Oct 2015

This really sounds like a hosting issue

avatar joewebber
joewebber - comment - 22 Oct 2015

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.

avatar joomdonation
joomdonation - comment - 22 Oct 2015

@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.

avatar joewebber
joewebber - comment - 22 Oct 2015

@joomdonation That works - thanks

avatar taur-firiath
taur-firiath - comment - 22 Oct 2015

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)

avatar roland-d
roland-d - comment - 22 Oct 2015

@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.

avatar taur-firiath
taur-firiath - comment - 22 Oct 2015

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.

avatar roland-d
roland-d - comment - 16 Nov 2015

@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.

avatar roland-d roland-d - change - 16 Nov 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-11-16 11:43:35
Closed_By roland-d
avatar roland-d roland-d - close - 16 Nov 2015
avatar roland-d roland-d - close - 16 Nov 2015
avatar wesley-if
wesley-if - comment - 18 Feb 2016

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.

avatar roland-d
roland-d - comment - 18 Feb 2016

@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.

avatar petervavro
petervavro - comment - 2 Mar 2016

The solution might be :

$jinput = &JFactory::getApplication()->input;

DOES NOT WORK :

$files = $jinput->files->get('jform');

WORKS :

$files = $jinput->files->get('jform', array(), 'raw');

Add a Comment

Login with GitHub to post a comment