Skip to Content

UI5 Attachments download file name

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 .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • 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 ).
    Add comment
    10|10000 characters needed characters exceeded