File UploadDownload Through NetWeaver Gateway
File UploadDownload Through NetWeaver Gateway
Gateway
FollowRSS feedLike
13 Likes 57,325 Views 39 Comments
lv_filename = <fs_key>-value.
ls_stream-value = ls_upld-value.
ls_stream-mime_type = ls_upld-mimetype.
ENDIF.
lw_file-filename = <fs_key>-value.
lw_file-value = is_media_resource-value.
lw_file-mimetype = is_media_resource-mime_type.
lw_file-sydate = sy-datum.
lw_file-sytime = sy-uzeit.
/sap/opu/odata/sap/ZDEMO_FILE_SRV/FileSet(lor.jpg)/$value
8) Browse your local file system and select your file. Once you upload the file SAP with automatically change the
HTTP method as PUT . Execute the method. lor.jpg file got uploaded with ~status_code = 204.
9) To download the file, just change the HTTP method to GET and execute. Program will read the existing file from
the Z table as per FileName.
Here we are passing lor.jpg so GET operation will download the file we uploaded in Z table.
Similarly you can upload any file type to the Z table and can download them. In my next blog I will upload files from
my UI5 application.