"file" and "image"
Purpose: adding of files and images (only paths to files from a project root, without initial "/" are stored in a database, files themselves are distributed into folders of models in the "userfiles/models/" folder)
Field type in SQL table: "char" or "varchar"
Additional parameters
"max_size"
Purpose: the maximum allowed file size
Possible values: integer value in bytes
By default: allowed extensions from the configuration file "config/settings.php"
"allowed_extensions"
Purpose: allowed extensions of files
Possible values: an array of extensions of a type of array ("doc", "docx", "pdf")
By default: allowed extensions from config/settings.php file
"allowed_mime_types"
Purpose: allowed mime types of files
Possible values: an array of types as array ("image/jpeg", "image/gif", "image/png")
By default: allowed extensions from "config/settings.php" file (only for the "image" datatype)
"max_width"
Purpose: the maximum allowed image width
Possible values: integer value in pixels
By default: allowed extensions from "config/settings.php" file
"max_height"
Purpose: the maximum allowed height of the image
Possible values: integer value in pixels
By default: allowed extensions from "config/settings.php" file
"form_preview_width"
Purpose: the maximum allowed width of the cropped copy of the image (for webforms)
Possible values: integer value in pixels
By default: 150
"form_preview_height"
Purpose: the most allowed height of the cropped copy of the image (for webforms)
Possible values: integer value in pixels
By default: 111
Samples
array("Product image ", "image", "image", array("required" => true, "max_size" => 5000000)) array("Download file", "file", "download_file", array("help_text" => "Descriptions of enterprise")) array("Resume", "file", "resume", array("allowed_extensions" => array("txt", "doc", "docx"))
Previous section
"date" and "date_time"