file.comp
The file widget contains the base64 encoded content of a file.
An upload window pops up in edit mode on mouse click on the widget.
On double-click the content of a file is stored to the download directory.
On this page:
Parameters
Parameter Name |
Description |
Default Value |
$value |
A JSON formatted string which represents widget's value. |
Empty string. |
$readonly |
The read-only flag. |
Empty string which equals to false . |
$prompt |
The text that is displayed when widget doesn't contain a file. |
No file selected |
$id |
HTML tag ID. |
Not defined. |
$icon |
The icon displayed near the text box containing a file name. |
find - the magnifier icon. |
$description |
The description that is displayed when mouse hovers over the widget. |
Empty string. |
$bgcolor |
The background color of the text box containing a file name. |
Not defined. |
Example
An example widget looks like this:
Configuration of the displayed example:
<& /input/file.comp,
id => 'test_file',
description => 'Attached file',
prompt => 'Please select a file',
readonly => 1,
value => q{"filename":"bytea.sql","content-type":"application/sql","base64":"U0hPVyBkYXRhX2RpcmVjdG9yeTsKVVBEQVRFIGFuYWxpc2kuY2VydGlmaWNhemlvbmkgU0VUIGRvYyA9IGVuY29kZShwZ19yZWFkX2JpbmFyeV9maWxlKCdkZW1vZG9jLnBkZicpLCAnYmFzZTY0JykgV0hFUkUgaWQgPSAxOwo="}
&>
</%method>
The File widget in readonly mode:
Click in edit mode opens the upload window:
Double-click opens the download window: