crm:uploadFile
Overview
The <crm:uploadFile> tag is used to display a file upload element on the page.
If only one upload file exists on the page then you can use the default values.
If multiple upload file components exist on the page then it is necessary to:
- Create for each image a string property for the file name.
- Handle file uploads overriding handleUploadImage method.
Attributes
Name | Required | Type | Default | Description |
---|---|---|---|---|
allowTypes | false | String | The supported file types that are defined in CRM.COM General Settings. | Regular expression for accepted file types, e.g. /(\.|\/)(gif|jpe?g|png)$/ |
dragDropSupport | false | Boolean | false | Specifies dragdrop based file selection from filesystem and works only on supported browsers. |
id | true | String | null | Unique identifier of the component. |
labelKey | false | String | key_choose | A valid key defined in translation properties file. Its translation through the glossary will be used as the presentable name of the component. |
managedBean | true | String | null | The name of the Java managed bean class that will be used for retrieving the component values. |
uploadMode | false | String | advanced | Mode of the fileupload element. Allowed values are simple and advanced. |
oncomplete | false | String | null | Defines the function call triggered when upload ends. |
parameterName | false | String | null | Defines the parameter name of the function call. |
parameterValue | false | String | null | Defines the parameter value of the function call. |
refresh | false | String | @form | Component(s) to update with ajax. |
sizeLimit | false | String | The maximum file size that is defined in CRM.COM Formatting Settings. | Individual file size limit in bytes. |
tip | false | String | null | A valid key defined in translation properties file. Its translation through the glossary will be used as the information message of the component. |
uploadMethod | false | String | handleFileUpload | Defines the function call triggered when a file is uploaded. |
visible | false | Boolean | true | Controls the visibility of the component. |
Getting Started
The following example shows an upload file component.