CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Increase upload size
Pages: [1]

Author Topic: Increase upload size  (Read 3267 times)

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Increase upload size
September 09, 2009, 07:30:36 am
Hello,

I am trying to increase the maximum size of the attachments in CiviMail (and also in the regular civicrm's 'Send an e-mail')

I have updated php.ini and now I have

 upload_max_filesize = 10M
 post_max_size = 20M

which are (after apache reload) confirmed by phpinfo()

However, 'Send an e-mail' still complains with message 'File size should be less than 2 MByte(s)' when I try to attach anything over 2 MB.

Much appreciated if someone could push me in the right direction...

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Increase upload size
September 09, 2009, 07:46:59 am

can you fix the following line (for now)

CRM/Core/BAO/File.php, line 290

can you also file an issue for this and we'll fix it for a future release

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

goran

  • I post occasionally
  • **
  • Posts: 85
  • Karma: 3
Re: Increase upload size
September 09, 2009, 08:31:27 am
Ok, after changes to lines 291-296

            $form->setMaxFileSize( 10 * 1024 * 1024 );
            $form->addRule( "attachFile_$i",
                            ts( 'File size should be less than %1 MByte(s)',
                                array( 1 => 10 ) ),
                            'maxfilesize',
                            10 * 1024 * 1024 );
        }

it worked (I had to increase memory_limit in php.ini, 9M attachment needed something like 130M of memory)

And.. thank you for the solution!
Issue opened at http://issues.civicrm.org/jira/browse/CRM-5024

lcdweb

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1620
  • Karma: 116
    • www.lcdservices.biz
  • CiviCRM version: many versions...
  • CMS version: Joomla/Drupal
  • MySQL version: 5.1+
  • PHP version: 5.2+
Re: Increase upload size
July 19, 2010, 10:58:29 am
I'm getting the "max size should be less than" warning message when uploading a file to an activity, but the file is much less than the configured max (150kb file, 2M max). php settings are fine (both max upload and post max).

I don't see where in CRM/Core/BAO/File.php it retrieves and compares the file's size against the max file size. even if I bump up the max file size, it still rejects the file. it will, however, upload very small files, so I think there's something going on with the mechanism to retrieve the file size.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Increase upload size

This forum was archived on 2017-11-26.