Skip to Content

UI5 Attachments download file name

Nov 10, 2017 at 08:14 AM


avatar image

Hello All ,

Can anyone tell me how can we show filename using GET Stream method .

I have already written code specified in FileName with GET_STREAM as below still file is getting downloded with name $value .

Any suggestions how can I get the attachment name and also please clarify is there any way I can find out whether it support particular browser .

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Irfan Gokak Nov 13, 2017 at 09:23 AM

Hi Tisha,

Do the changes in your GET_STREAM method as below.

*---Set File Name for the file to be downloded
    ls_lheader-name = 'Content-Disposition'.
*    ls_lheader-value = 'outline; filename=Mobile.pdf;'.
    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.

* Return the data

    is_data = ls_stream CHANGING
      cr_data = er_stream ).
Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Irfan

I have done same changes but still file is downloaded with name $value


Try passing hardcoded filename. I'm using the same thing and its working fine.