We use the "image URL" field via profile to allow members to upload their organization logo. We would like to limit the file size a user can upload. Are there any options for us? Thank you!
-
1Are you using Drupal, Joomla or WP?– ColemanCommented Oct 14, 2017 at 12:38
-
We are using WP and CiviCRM 4.7.14.– Ferdinand WepsCommented Oct 15, 2017 at 18:36
-
Are you uploading other files that will be larger than the image file size?– SleewokCommented Oct 17, 2017 at 20:37
1 Answer
You should be able to implement a hook via PHP to validate the profile when it is submitted: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_processProfile/.
Someone else may want to chime in. I'm not sure if you can use form hooks with profiles. Otherwise you may check this: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_validateForm/
You can then use PHP to validate the file size: Check this thread (https://stackoverflow.com/questions/9153224/how-to-limit-file-upload-type-file-size-in-php).