Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

download without save dialog

Hi,

I use the method below to download attachment from BSP.

      lv_contenttype = 'application/octet-stream'.

          CONCATENATE 'attachment; filename=' lv_name
            INTO lv_contentdisposition.

          CALL METHOD runtime->server->response->set_header_field
            EXPORTING
              name  = 'content-disposition'
              value = lv_contentdisposition.

          CALL METHOD runtime->server->response->set_header_field
            EXPORTING
              name  = 'content-type'
              value = lv_contenttype.

          CALL METHOD runtime->server->response->set_header_field
            EXPORTING
              name  = 'content-filename'
              value = lv_name.

        lv_chunksize = 1022.
        LOOP AT lt_contents INTO ls_contents.
          MOVE ls_contents-line TO xwa.
          xwa_len = lv_file_size - ( lv_chunksize * ( sy-tabix - 1 ) ).

          IF xwa_len >= lv_chunksize.
            xwa_len = lv_chunksize.
          ENDIF.
          runtime->server->response->append_data( data   = xwa
                              length = xwa_len ).
        ENDLOOP.

        navigation->set_parameter( name  = 'content_length'
                                   value = lv_file_size ).
        runtime->server->response->delete_header_field(
                  name = 'Cache-Control' ).
        runtime->server->response->delete_header_field(
                  name = 'Expires' ).
        navigation->response_complete( ).

But this only allow to download 1 attachment at each time?

I have a service ticket that tight with few attachments. On my BSP page, there is a download button, is it possible to download those attachments at the same time to desktop and without saving dialog pop out?

Kindly advise.

thanks,

ginnie

Former Member
Not what you were looking for? View more on this topic or Ask a question