I have problem with my custom created field for custom node type. This is field instance configuration:
'attachments' => array(
'field_name' => 'vintranet_talk_attachments',
'label' => t('Attachments'),
'entity_type' => 'node',
'bundle' => 'mynodetypename',
'widget' => array(
'type' => 'file_mfw',
),
'settings' => array(
'max_filesize' => 1024 * 1024 * 10,
'file_directory' => 'my/path',
'file_extensions' => 'jpg,png,gif,pdf,zip,doc,rtf,xdoc,rar,txt',
'description_field' => 1,
),
'display' => array(
'default' => array(
'type' => 'file_table',
),
),
),
After installing my module, I wanted to add new node and add some attachments, but I get this error:
Why I can't upload my *.txt
file (same with jpg
and others) even if I have this file format in "Allowed file types" list?
Only after editing particular node type field settings from the backend page (just by pressing "save" button) everything works perfect...
The answer is to change value of file_extensions
to jpg png gif pdf zip doc rtf xdoc rar txt
.