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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Upload limit error
Pages: [1]

Author Topic: Upload limit error  (Read 256 times)

ewanmclean

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
Upload limit error
December 05, 2014, 09:26:24 am
Hi there

I started writing this post, then changed my PHP settings to allow > 2M uploads which solved the issue. I'm still posting it because the error messages Civi displays are confusing (it says the limit is 10M), see below. Just for feedback :)



I'm having some trouble uploading file attachments to notes. I have upgraded to the latest version but this didn't have any effect. When I try to upload a 2MB file I get an error saying the maximum limit is 10MB, which doesn't seem to make much sense. I did some searching on here and I've tried various bodges to sites/all/modules/civicrm/CRM/Core/BAO/File.php:

Tried changing this value to 20MB:    $maxFileSize = $config->maxFileSize ? $config->maxFileSize : 2;
Tried commenting out the block beginning:       $form->addRule("attachFile_$i",
Tried commenting out this line:       $form->setMaxFileSize($maxFileSize * 1024 * 1024);
Tried adding * 10000 to the end of both lines where this is mentioned:       $form->setMaxFileSize($maxFileSize * 1024 * 1024);

Nothing makes any difference at all, except for removing the 'addRule' block, which let the action go through, but didn't actually attach the file.

Much smaller files (10KB) work fine.

Apart from anything else, one part of this file seems to set the limit at 2M, and another at 10M.

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Upload limit error
December 08, 2014, 11:54:40 am
Have you tried adjusting the DB settings at:

www.yoursite.org/civicrm/admin/setting/misc?reset=1
Try CiviTeacher: the online video tutorial CiviCRM learning library.

ewanmclean

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 0
Re: Upload limit error
December 08, 2014, 04:45:47 pm
That's at 10MB. It does have a note to say php.ini should support that size, but nowhere does the script actually error on it.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Upload limit error

This forum was archived on 2017-11-26.