‎2013 Sep 28 6:20 PM
Hi,
I need to transfer a file residing on the servers' HDD via HTTP to a client. The file can be transferred via web service or basic HTTP Response. How can I accomplish that?
thanks,
‎2013 Sep 30 7:29 PM
Hi Ferudun,
Did you read the post http://scn.sap.com/thread/1646766 ?
Perhaps it can help you to send the file via http post.
Regards,
Christian
‎2013 Sep 30 10:31 PM
Here is a summary of how to do it with an HTTP Post:
data: lo_http_client type REF TO if_http_client,
l_file type xstring.
cl_http_client=>create(
EXPORTING
host = `example.com/target/path`
IMPORTING
client = lo_http_client ).
lo_http_client->request->set_method(
if_http_request=>co_request_method_post ).
OPEN DATASET my_file FOR INPUT IN BINARY MODE.
... "Fill l_file
CLOSE DATASET my_file.
lo_http_client->request->set_data( l_file ).
* Replace text/html with appropriate MIME type
lo_http_client->request->set_content_type( `text/html` ).
lo_http_client->send( ).