max_upload_size ignored when uploading from tinyMCE

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

max_upload_size ignored when uploading from tinyMCE

Post by mikemcvey »

Hi,

I have set my max_upload_size in config.php to be 2MB...
I have clients uploading files using tinyMCE.. any idea on why they have been able to upload pdf's which are 7MB!

Searched the code base but at a bit of a loss.. any help much appreciated.

Mike
tgmayfield
Forum Members
Forum Members
Posts: 11
Joined: Tue Apr 24, 2007 5:51 pm

Re: max_upload_size ignored when uploading from tinyMCE

Post by tgmayfield »

The directive is upload_max_filesize.

--Thomas
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

Re: max_upload_size ignored when uploading from tinyMCE

Post by mikemcvey »

So is this an error with cms 1.1.1?
as the config file states:

$config['max_upload_size'];

I just searched the whole code base and only found "upload_max_filesize" in the following files..

CMSInstallerPage1.class.php
CMSInstallerPage5.class.php

And looks likt the file is set through an ini file...
CAn I change this to disable uploads over 2MB? will the config.php vaue be ignored?
tgmayfield
Forum Members
Forum Members
Posts: 11
Joined: Tue Apr 24, 2007 5:51 pm

Re: max_upload_size ignored when uploading from tinyMCE

Post by tgmayfield »

Ack. Mea culpa. Misunderstood your problem. upload_max_filesize is the PHP directive, not the CMSMS directive.  The CMSMS directive is only used, however, in the hidden element on the admin/imagefiles.php and admin/files.php.  From what I can see (and I'll be talking to the TinyMCE maintainer about this), it's not used in any of the TinyMCE configuration.

What you can do, if you're running on an apache server, is create a .htaccess file (or modify one if it's already there) in your site root with the content:

Code: Select all

php_value upload_max_filesize 2M
That will take precedence over any other value specified elsewhere.
mikemcvey
Forum Members
Forum Members
Posts: 61
Joined: Tue May 02, 2006 4:08 am

Re: max_upload_size ignored when uploading from tinyMCE

Post by mikemcvey »

sweet...

makes sense to me.. already got an .htaccess file so will do that.

Thank you so much for your help!

Mike
Post Reply

Return to “Developers Discussion”