Skip to content

Instantly share code, notes, and snippets.

@fleischr
Created November 14, 2022 15:42
Show Gist options
  • Save fleischr/8648de68981f44603853c76bf105c5ea to your computer and use it in GitHub Desktop.
Save fleischr/8648de68981f44603853c76bf105c5ea to your computer and use it in GitHub Desktop.
report zwritebinaryfiletohttp.
part = client->request->add_multipart( ).
CALL METHOD part->set_header_field
EXPORTING
name = 'content-disposition'
value = 'form-data;name="file"; filename="file.bin";'.
CALL METHOD part->set_header_field
EXPORTING
name = 'content-type'
value = 'bin'.
OPEN DATASET '/file.bin FOR INPUT IN BINARY MODE.
read dataset '/file.bin' into data.
len = xstrlen( data ).
CALL METHOD part->set_data
EXPORTING
data = data
offset = 0
length = len.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment