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.
$id HTML tag ID. Not defined.
$description The description that is displayed when mouse hovers over the widget. 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
$bgcolor The background color of the text box containing a file name. Not defined.
$icon The icon displayed near the text box containing a file name. find - the magnifier icon.

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:

FileCompReadonly.png

Click in edit mode opens the upload window:

FileCompUploadWindow.png

Double-click opens the download window:

FileCompDownload.png
Topic revision: r2 - 08 Feb 2017, JanezStangelj
This site is powered by FoswikiCopyright (©) Leader.IT - Italy P.I. IT01434390223 Privacy policy & use of cookies