
You can use the FileUpload UI element to upload files from the client to the server. The UI element appears with an InputField, in which the directory path and the file name appear, and a Button for searching for the file.
Note that you must always specify the fully qualified path for a FileUpload UI element.Therefore, you cannot specify any URLs.
More information:
http://support.microsoft.com/kb/892442/en-us
|
|
Technical Browser Details Beyond the Control of WDA
Due to browser restrictions that are unrelated to Web Dynpro ABAP, the previously entered data path might disappear when a FileUpload UI element is clicked. In newer versions of the browser, it is therefore not possible to enter the file name in the entry field. The field always remains empty.Neither are any potential restrictions shown, for example, file names or file name extensions. Therefore in new browser versions the file name can only be selected using the Browse... button. You cannot enter the file name manually (using the keyboard or copy and paste functions), nor can the file name be set by the back end (directly or using context binding).
For more details, read the security information in Internet Explorer 6 about handling <input type=file>.
For security reasons, the browser only accepts absolute paths or a path selection using the Browse . switch. If the path name is incorrect, the browser will not even forward the request.
Procedure
There is no action available to identify a FileUpload. Generally we recommend you use a dedicated screen or popup for the upload, since an upload is triggered by every user interaction requiring a roundtrip, for example scrolling through a table. This makes a roundtrip necessary, which may irritate the user.
Check with every action whether data has been downloaded by reading the data from the context.
The delete the data immediately from the context.Otherwise the file will be kept in the memory until the context is deleted or a new upload is triggered.
Note also the Security Notes for FileUpload UI Elements .
When copying from XSTRING to XSTRING no copy of the data is made due to ABAP string sharing. A copy is not created until the data is modified in one of the XSTRINGs.
Implementation Details
|
Runtime Class |
CL_WD_FILE_UPLOAD |
|
Name |
Type |
Initial Value |
Bindable |
|---|---|---|---|
|
STRING |
(automatic) |
No |
|
|
WDY_BOOLEAN |
false |
No |
|
|
WDUI_CONTEXT_MENU_BEHAVIOUR |
inherit |
No |
|
|
WDY_MD_UI_ELEMENT_REFERENCE |
No |
||
|
XSTRING |
Yes |
||
|
WDY_BOOLEAN |
true |
Yes |
|
|
Translatable text |
No |
||
|
STRING |
Yes |
||
|
STRING |
Yes |
||
|
WDUI_STATE |
normal |
Yes |
|
|
WDUI_TEXT_DIRECTION |
inherit |
Yes |
|
|
Translatable text |
Yes |
||
|
WDUI_VISIBILITY |
visible |
Yes |
|
|
STRING |
Yes |
Other properties that can be inherited are defined in the related higher-level classes. The related UI elements are:
Accessibility
To enable the development of accessible applications the property label is checked during the syntax check.
If no label has been set, and no descriptive text has been specified for the appropriate bound context element in the ABAP Dictionary, the property tooltip is checked.
Dynamic Programming
For dynamic programming, the same properties, events and aggregations are available as in the View Designer.But note that the spelling format and use of upper/lower case is different.
|
View Designer Name |
Runtime Name |
Type |
|---|---|---|
|
ACTIVATE_ACCESS_KEY |
WDY_BOOLEAN |
|
|
CONTEXT_MENU_BEHAVIOUR |
WDUI_CONTEXT_MENU_BEHAVIOUR |
|
|
contextMenuBehaviour: inherit |
CL_WD_FILE_UPLOAD=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT |
|
|
contextMenuBehaviour: provide |
CL_WD_FILE_UPLOAD=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE |
|
|
contextMenuBehaviour: suppress |
CL_WD_FILE_UPLOAD=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS |
|
|
CONTEXT_MENU_ID |
WDY_MD_UI_ELEMENT_REFERENCE |
|
|
DATA |
XSTRING |
|
|
ENABLED |
WDY_BOOLEAN |
|
|
EXPLANATION |
WDY_MD_TRANSLATABLE_TEXT |
|
|
FILE_NAME |
STRING |
|
|
MIME_TYPE |
STRING |
|
|
STATE |
WDUI_STATE |
|
|
state: normal |
CL_WD_FILE_UPLOAD=>E_STATE-NORMAL |
|
|
state: required |
CL_WD_FILE_UPLOAD=>E_STATE-REQUIRED |
|
|
TEXT_DIRECTION |
WDUI_TEXT_DIRECTION |
|
|
textDirection: inherit |
CL_WD_FILE_UPLOAD=>E_TEXT_DIRECTION-INHERIT |
|
|
textDirection: ltr |
CL_WD_FILE_UPLOAD=>E_TEXT_DIRECTION-LTR |
|
|
textDirection: rtl |
CL_WD_FILE_UPLOAD=>E_TEXT_DIRECTION-RTL |
|
|
TOOLTIP |
WDY_MD_TRANSLATABLE_TEXT |
|
|
VISIBLE |
WDUI_VISIBILITY |
|
|
visible: none |
CL_WD_FILE_UPLOAD=>E_VISIBLE-NONE |
|
|
visible: visible |
CL_WD_FILE_UPLOAD=>E_VISIBLE-VISIBLE |
|
|
WIDTH |
STRING |
For test purposes 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 FileUpload view.