Hello Experts,
I am trying to upload file in open text environment from sap CRM.
The problem I am facing is I am not able to set the Content Type or mime type for the file I am uploading.
I am using set_content_type method to do this.
Please help me out for this.
Below is some part of the code I have written.
part = p_http_client->request->if_http_entity~add_multipart( ).
DATA: lv_value TYPE string.
CONCATENATE 'form-data; name="file"; filename="' p_filename '";' INTO lv_value."
***CONCATENATE 'form-data; name="file"; filename="' p_filename '"; content_type= "application/pdf" ' INTO lv_value."
part->set_header_field( name = 'Content-Disposition' value = lv_value ).
len = xstrlen( p_is_request-file_content ).
* CALL METHOD part->set_content_type
* EXPORTING
* content_type = p_content_type. "application/pdf
CALL METHOD part->set_data
EXPORTING
data = p_is_request-file_content
* offset = 0
length = len.
Thanks & Regards,
Chhanda Sarkar