Skip to Content

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

How to send additional parameters with file upload

Hi,

When I upload a file, using SAP GW, de "data" parameter is fileld with the file. However, I'd like to send additional info with the post method.

In the backend the "create_stream" method is called, and I noticed there is an import parameter "IT_KEY_TAB", so it must be possible to send some additonal parameters with the request.

In short: is there anyone who can tell me how I can add a parameter e.g. "Guid" in this post method:

jQuery

     .ajax({

     type : 'POST',

     url : "xxx/sap/opu/odata/sap/ZK_MOBILE_SERVICEDESK_SRV/Files",

     headers : oHeaders,

     cache : false,

     contentType : false,

     dataType : "json",

     processData : false,

     data : file,

          success : function({}),

     ...


Thanks,


RW

Former Member
Former Member replied

Hi Robbe,

I think you have two options:

1. you can use http request header parameter slug, just insert this into oHeaders and then you will see its value in iv_slug in create_stream. You can make your own logic to separate more fields if you need.

2. you can add you own request header parameter. And then read it according to solution in this thread

How to get HTTP headers from Data Provider Class?

Best regards,

Peter

0 View this answer in context

Helpful Answer

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