cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori App - Documents as attachment does not work in Mobile/Tab Devices

SandipAgarwalla
Active Contributor
0 Kudos

Hello All

We have a custom App, where in a Link has been given thru which the user can open the document (pdf/doc) in a separate browser window. The document is coming from oData service as binary string. The URL is calculated using the following

/Service/EntitySet(key)/$value

The URL works fine in Desktops. However it does not work in Mobile devices . When the user clicks on the links, a download starts, after that the document does not open. Here are some screen shots

Thanks

Sandip

Accepted Solutions (0)

Answers (1)

Answers (1)

irfan_gokak
Contributor
0 Kudos

Hi Sandeep,

Add below code snippet in your GET_STREAM.

*---Set File Name for the file to be downloded
    ls_lheader-name = 'Content-Disposition'.
    concatenate 'outline; filename=' ls_zzupld-filename INTO ls_lheader-value.
    set_header( is_header = ls_lheader ).
    CLEAR ls_lheader.


*---Set Content Type in header
    ls_stream-mime_type = ls_zzupld-mimetype.
    ls_stream-value = ls_zzupld-value.

    copy_data_to_ref(
  EXPORTING
    is_data = ls_stream CHANGING
      cr_data = er_stream ).

Please mark as answered if this is helpful.