Constructor
new File(name)
Creates a new File component instance
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the component, used as name of the html controls. |
- Source:
Returns:
A newly created File component
Methods
checkRequirements(reqData, tracker)
Validates a file upload by making sure it's there (if REQUIRE is set),
checking the file size, the content type and by trying to construct an image.
Parameters:
Name | Type | Description |
---|---|---|
reqData |
Object | request data |
tracker |
jala.Form.Tracker | jala.Form.Tracker object storing possible error messages |
- Source:
Returns:
null if everything is ok or string containing error message
renderControls(attr, value, reqData)
Renders a file input tag to the response.
Parameters:
Name | Type | Description |
---|---|---|
attr |
Object | Basic attributes for this element. |
value |
Object | Value to be used for rendering this element. |
reqData |
Object | Request data for the whole form. This argument is passed only if the form is re-rendered after an error occured. |
- Source: