The FILE_UPLOAD widget is a type of widget used to allow a user to specify a file on their local computer to be uploaded to the server. It will appear as a text field with a Browse...1button beside it. The user can click on the button to open a file dialog box with which they can select their file.
There are three application-level configuration settings for the FILE_UPLOAD widget. These control how the web-server handles the incoming files. Default settings are already present, but the default values can be overridden by adding configuration settings to the ApplicationConfiguration.properties file. The settings follow the same name = value format of all the other entries there. The settings are as follows:
The WIDGET element should have the TYPE attribute set to FILE_UPLOAD. The widget supports the following WIDGET_PARAMETER elements:
Parameter Name |
Required |
Description and Connections |
---|---|---|
CONTENT |
Yes |
This parameter indicates the target connection for the actual content of the uploaded file. A single CONNECT element with a TARGET that connects to a property of an ACTION phase server interface is required. |
FILE_NAME |
No |
This parameter represents the name of the file to be uploaded. The parameter can be set to provide a default name for the file to be uploaded, and can also supply the name of the file chosen by the user. If present, the parameter can include CONNECT elements for either or both end-points: a SOURCE end-point for the initial name of the file, and a TARGET end-point for the file that was actually chosen. The SOURCE end-point can specify a property of a DISPLAY phase server interface. The TARGET end-point can specify a property of an ACTION phase server interface. Note: Many browsers do not allow a default value for the name of a file to be uploaded. In this case, setting a SOURCE connection will have no effect. |
CONTENT_TYPE |
No |
This parameter indicates the target connection for the content type of the uploaded file. The content type describes the format of the uploaded data. For example, a simple text file would have a content type of "text/plain" and a Microsoft Word document would have a content type of "application/msword". A single CONNECT element with a TARGET that connects to a property of an ACTION phase server interface is required. |
ACCEPTABLE_CONTENT_TYPES |
No |
A HTML page only allows certain types of content to be uploaded by default (the actual default types are dependent on the browser). This parameter can specify the types of content that the page will accept. The value of the parameter should be a comma-separated list of content types. If there is more than one FILE_UPLOAD widget on a page, the acceptable content types of all widgets are pooled together and define what is acceptable for that page (this is a limitation of the HTML specification.) A single CONNECT element with a SOURCE that connects to a TEXT property is allowed. |