CiviCRM Attachments


If you see a message like this:
Attachment save error then you have probably tried to save a file where the filename is too long.

The file input field is added by /sites/all/modules/CRM/Core/BAO/File.php, e.g.

$form->addElement('file', "attachFile_$i", ts('Attach File'), 'size=30 maxlength=60');

The maxlength of the field set on the input field is enforced when the record is saved.

While changing maxlength=60 to a higher number is possible it probably isn’t desirable as there may be other unwanted side effects.

An additional observation is that this limit only seems to be enforced in pop-up windows.

Comment on this article using form below. Requires email login only for authentication. HTML forbidden, Markdown only.