Show TOC Start of Content Area

Object documentation FileDownload API  Locate the document in its SAP Library structure

Definition

Using the FileDownload element, the user can load a file from the server to the client to store it there or to open it in the appropriate program. The look of the FileDownload elements resembles a link, because the representation is determined by the type property, which provides the option of indicating whether the user has clicked the element before.

This graphic is explained in the accompanying text

The data source, that is the file to be downloaded is determined by the resource property. The target property determines the ID of the target window in the browser.

Description of UI Element Properties

     behaviour

determines the behavior after the user has clicked the FileDownload element.
behaviour is of enumeration type WDFileDownloadBehaviour and can have the following values:

     allowSave

An Open/Save dialog box appears. The user can directly save the file locally or open it with the appropriate program.

     auto

The behavior is predefined and depends on the MIME type of the file to be downloaded. The list below describes the behavior for the individual file types; false means that the attachment is opened in the same window, whereas for true a new window is opened.

Constant

File Extension

MIME Type acc. W3C

Attachment

APPLET

"jar"

"application/x-java"

true

CSS

"css"

"text/css"

false

DOC

"doc"

"application/vnd.ms-word"

"application/x-msword"

false

FLASH

"swf"

"application/x-shockwave-flash"

false

GIF_IMAGE

"gif"

"image/gif"

false

HTML

"html"

"text/html"

false

JAVA

"java"

"application/x-java"

false

JAVA_SCRIPT

"js"

"text/js"

false

JPG_IMAGE           

"jpg"    

"image/jpeg"           

false

PDF

"pdf"

"application/pdf"

false

PNG

"png"

"image/x-png"

false

PPT

"ppt"          

"application/vnd.ms-powerpoint" "application/x-mspowerpoint"

false

PS             

"ps"

"application/postscript"

false

RTF

"rtf"

"application/rtf"             

false

SVG

"svg"

"image/svg+xml"

false

TXT

"txt"

"text/plain"

false

UNKNOWN

""

""

true

VML

"vml"

"text/vml"

false

WD_APPLICATION

""

""

false

XLS

"xls"

"application/vnd.ms-excel"

"application/x-msexcel"

false

XML                 

"xml"

"text/xml"

false

XML_CONFIGURATION

"xml"

"text/xml"

true

     openInplace

The file is opened in the appropriate application program within the current window. Which program is opened, depends on the MIME type of the file.

     data

This property is deprecated, use resource instead.

     imageFirst

Defines the position of the icon in relation to the corresponding text. If the value of this property is true, the icon is displayed to the left of the text.

     imageHeight

Determines the height of the graphic next to the FileDownload link. You can specify the height in CSS units like em, ex, pixels, or percentage.

     imageSource

Specifies the Web address (URL) of the icon to be displayed. You can assign an absolute Web address – http:// … to this property.
If you store the icons in the directory 
mimes/Components/<component class> of the Web Dynpro project in the Navigator using the menu item Import, you must only enter the icon name - for example, icon.gif. The URL Generation Service automatically determines the URL of the icon.
You can also store the icons in the directory
mimes/Applications/<application class>. In this case, you must manually create the URL using the URL Generation Service.
If you use the SAP icons and want to refer to them, you can use the alias
~sapicons. If you assign the alias ~sapicons/<name>.gif to the imageSourceproperty, you refer to an icon called <name>.gif of the SAP icons. For a description and a listing of all possible SAP icons, see the SAP Design Guild under http://www.sapdesignguild.org/. Select the following path:
Sitemap
Resources  Visual Design & Icons SAP R/3 Icons R/3 Icon Lists. 
The filename of the icon consists of the bitmap name entered in the table and the prefix “s_”. If the bitmap name in the table is F_CUTO, you need to enter ~sapicons/s_f_cuto.gif to reference to the SAP icon
This graphic is explained in the accompanying text.

     imageWidth

Determines the width of the graphic next to the FileDownload link. You can specify the width in CSS units like em, ex, pixel, or percentage.

     resource

Specifies the data source and contains the data, the file name, and the MIME type. The resource property must be bound to a context attribute of the type Resource.

     size
Specifies the size of the FileDownload element. The size property can take the following values and is represented by the enumeration type WDLinkSize.

small

The UI element is displayed with a small font.

standard

A default size is displayed.

     target

Specifies the browser window in which the page is to be opened. You can manually specify the name of the target window or use the following values:

     ""
The page is opened in a new window without a name. For every file download a new window will be opened

     _self is no longer supported. Use exit plugs instead and specify the URL there.

     “<window name>”. You can specify a window name as string. For every file download the same window will be opened.

     text

Describes a label text.

     textDirection

Specifies the text direction and allows you to read the texts of subordinated UI elements in languages which require a specific text direction. The textDirection property can be filled with the following values and is represented by the enumeration type WDTextDirection.

inherit

The text direction is inherited from the parent element. Therefore, the text direction is identical to the one of the parent element.

ltr

The text runs from left to right.

rtl

The text runs from right to left.

The default value for this property is inherit.

     type

Describes the graphical representation of the FileDownload element. The type property can be filled with the following values and is represented by the enumeration type WDLinkType.

function

This graphic is explained in the accompanying text

The UI element appears in the standard design and underlined.

navigation

This graphic is explained in the accompanying text

The UI element appears underlined and in the color used for links that the user has already visited.

reporting

This graphic is explained in the accompanying text

The UI element appears in the standard design and not underlined.

result

This graphic is explained in the accompanying text

The UI element appears not underlined.

     wrapping

Indicates whether or not the text of the FileDownload element is wrapped. If the initial value is false, the text is not wrapped.

Overview of Inherited and Additional Properties

Name

Interface

Type

Initial Value

bindable

Value Required

behaviour

IWDFileDownload

WDFileDownloadBehaviour

auto

bindable

No

data

IWDFileDownload

Object

 

bindable_mandatory

No

enabled

IWDUIElement

boolean

true

bindable

No

imageFirst

IWDAbstractCaption

boolean

true

bindable

No

imageHeight

IWDLink

String

 

bindable

No

imageSource

IWDAbstractCaption

String

 

bindable

No

imageWidth

IWDLink

String

 

bindable

No

resource

IWDFileDownload

IWDResource

 

bindable_mandatory

Yes

size

IWDLink

WDLinkSize

standard

bindable

No

target

IWDFileDownload

String

 

bindable

No

text

IWDLink

String (TranslatableText)

 

bindable

No

textDirection

IWDAbstractCaption

WDTextDirection

inherit

bindable

No

tooltip

IWDUIElement

String (TranslatableText)

 

bindable

No

type

IWDFileDownload

WDLinkType

navigation

bindable

No

visible

IWDUIElement

WDVisibility

visible

bindable

No

wrapping

IWDLink

boolean

false

bindable

No

 

 

End of Content Area