!--a11y-->
FileDownload 
FileDownload is used to load filed from the server onto the client. The data property determines the data source in the view context. The target property determines the ID of the target window in the browser.
Files from a FileDownload UI elements are accessed when the user initiates a request for a specific file, that is, when the user clicks on a link. This way of accessing files enables large date sets to be processed.
For this access procedure the FileDownload.data property must be linked to a context node that meets the following criteria:
● It has a supply function
● It has only one attribute with data of type XSTRING
This ensures that the supply function is not called until the user requests the data. To use the supply function in a table you need such a node within your Table.dataSource node.

Note that this does not concern a singleton, as this could lead to short dumps in your application.
To avoid having unnecessary data in the context, the FileDownload node is invalidated after the download. This however only happens if the node was not made available before the download. Consequently no data can get lost.
To find out how to download a file without using the UI element see File Export.

If the properties text and label have not been set, the property tooltip is checked during the design time to ensure Accessibility.
A tooltip does not necessarily have to be set for this UI element, but it could make sense to set it, if it contains detailed semantic information.
Runtime Class |
CL_WD_FILE_DOWNLOAD |
Properties in the View Designer
Name |
Type |
Initial Value |
Bindable |
ID |
STRING |
(automatic) |
No |
WDUI_FILE_DOWNLOAD_BHVR |
auto |
Yes |
|
XSTRING |
|
mandatory |
|
WDY_BOOLEAN |
true |
Yes |
|
STRING |
|
Yes |
|
WDY_BOOLEAN |
true |
Yes |
|
STRING |
|
Yes |
|
STRING |
|
Yes |
|
STRING |
|
Yes |
|
STRING |
|
Yes |
|
STRING |
_blank |
Yes |
|
Text |
|
Yes |
|
WDUI_TEXT_DIRECTION |
inherit |
Yes |
|
Text |
|
Yes |
|
WDUI_LINK_TYPE |
navigation |
Yes |
|
WDUI_VISIBILITY |
visible |
Yes |
|
WDY_BOOLEAN |
false |
Yes |

Further properties that can be inherited are defined in the associated higher-level class. The associated interface elements are:
● Link
For dynamic programming the same properties, events, and aggregations are provided in the View Designer. Bear in mind the different spellings.
Dynamic Programming of Properties
View Designer Name |
Runtime Name |
Type |
DATA |
XSTRING |
|
BEHAVIOUR |
WDUI_FILE_DOWNLOAD_BHVR |
|
behaviour: allowSave |
CL_WD_FILE_DOWNLOAD=>E_BEHAVIOUR-ALLOW_SAVE |
|
behaviour: auto |
CL_WD_FILE_DOWNLOAD=>E_BEHAVIOUR-AUTO |
|
behaviour: openInplace |
CL_WD_FILE_DOWNLOAD=>E_BEHAVIOUR-OPEN_INPLACE |
|
ENABLED |
WDY_BOOLEAN |
|
FILE_NAME |
STRING |
|
IMAGE_FIRST |
WDY_BOOLEAN |
|
IMAGE_HEIGHT |
STRING |
|
IMAGE_SOURCE |
STRING |
|
IMAGE_WIDTH |
STRING |
|
MIME_TYPE |
STRING |
|
TARGET |
STRING |
|
TEXT |
WDY_MD_TRANSLATABLE_TEXT |
|
TEXT_DIRECTION |
WDUI_TEXT_DIRECTION |
|
textDirection: inherit |
CL_WD_FILE_DOWNLOAD=>E_TEXT_DIRECTION-INHERIT |
|
textDirection: ltr |
CL_WD_FILE_DOWNLOAD=>E_TEXT_DIRECTION-LTR |
|
textDirection: rtl |
CL_WD_FILE_DOWNLOAD=>E_TEXT_DIRECTION-RTL |
|
TOOLTIP |
WDY_MD_TRANSLATABLE_TEXT |
|
TYPE |
WDUI_LINK_TYPE |
|
type: function |
CL_WD_FILE_DOWNLOAD=>E_TYPE-FUNCTION |
|
type: navigation |
CL_WD_FILE_DOWNLOAD=>E_TYPE-NAVIGATION |
|
type: reporting |
CL_WD_FILE_DOWNLOAD=>E_TYPE-REPORTING |
|
type: result |
CL_WD_FILE_DOWNLOAD=>E_TYPE-RESULT |
|
VISIBLE |
WDUI_VISIBILITY |
|
visible: none |
CL_WD_FILE_DOWNLOAD=>E_VISIBLE-NONE |
|
visible: visible |
CL_WD_FILE_DOWNLOAD=>E_VISIBLE-VISIBLE |
|
WRAPPING |
WDY_BOOLEAN |
|
data type file string. data dot_offset type i. data extension type mimetypes-extension. data mimetype type mimetypes-type.
file = 'Image.jpg'.
" Find out file name extension find first occurrence of regex '\.[^\.]+$' in file match offset dot_offset. add 1 to dot_offset. extension = file+dot_offset.
" Get mime type call function 'SDOK_MIMETYPE_GET' exporting extension = extension importing mimetype = mimetype. |
You can find examples of this interface element in the system in the Web Dynpro application WDR_TEST_UI_ELEMENTS, and in the component WDR_TEST_EVENTS in the View FileDownload.