Skip to content

ORM Model File Column

Darryl Hein edited this page Dec 20, 2013 · 9 revisions

Allowed Types using Mimes

<?php
			'field_options' => array(
				'file_options' => array(
					'destination_folder' => UPLOAD_ROOT_GALLERY,
					'name_change_method' => 'id',
					'allowed_types' => array('image/pjpeg', 'image/jpeg'),
				),
			),

Allowed Types using Extensions

<?php
			'field_options' => array(
				'file_options' => array(
					'destination_folder' => UPLOAD_ROOT_GALLERY,
					'name_change_method' => 'id',
					'ext_check_only' => TRUE,
					'allowed_extensions' => array('pdf'),
				),
			),

Alternate Filename Display

<?php
			'field_options' => array(
				'file_options' => array(
					'destination_folder' => UPLOAD_ROOT_GALLERY,
					'name_change_method' => 'id',
					'original_filename_column' => NULL,
					'alternate_filename_display' => 'Download',
					'ext_check_only' => TRUE,
					'allowed_extensions' => array('pdf'),
				),
			),

If the model name is 2 or more words, then you'll need to add 'model_name' => 'Supplier_Logo',

To change the original filename column, add 'original_filename_column' => 'new_col_name',