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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom field type file: max size
Pages: [1]

Author Topic: Custom field type file: max size  (Read 1729 times)

taram

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 2
Custom field type file: max size
October 28, 2008, 02:58:43 pm
Hello,
I have added a new custom field of type 'File' to my org profile and would like to limit the file size that can be attached to 5MB and the file types to .doc, .rtf, and .pdf. Is this part of a setting somewhere or do I need to do it by adding validation code?
I appreciate your help.
-Tara.

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: Custom field type file: max size
October 28, 2008, 03:07:21 pm
Part 2: Administer CiviCRM > Safe File Extension Options (option list section)
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

taram

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 2
Re: Custom field type file: max size
October 28, 2008, 03:19:15 pm
Thanks for your reply.
I do not see this option (Safe file extension) in option lists section of my Administer civicrm. I am currently running civicrm version 2.0.6. Is this option available in a later version of civicrm?

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: Custom field type file: max size
October 28, 2008, 03:53:00 pm
Yes, it's new in v2.1

Not sure if you have that level of control in previous versions.
support CiviCRM through 'make it happen' initiatives!
http://civicrm.org/mih

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: Custom field type file: max size
October 28, 2008, 04:19:56 pm

for file size you will need to write a custom validation hook and check file size in that function

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

taram

  • I post occasionally
  • **
  • Posts: 35
  • Karma: 2
Re: Custom field type file: max size
October 29, 2008, 09:01:55 am
Since we are not moving to civicrm 2.1 anytime soon, I will write custom validation code.
Thanks for your help.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Custom field type file: max size

This forum was archived on 2017-11-26.