on 05-27-2014 10:57 AM
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
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
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robbe,
If you are posting a file to a navigation property that points at the corresponding media link entityset; then the key fields are filled with the previous entity.
e.g. Posting a file to Employees('12345')/Attachments will automatically give you the employee id as a key within create_stream.
Cheers,
Matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IT_KEY_TAB is for different purpose.
To pass extra parameter you may use a header called SLUG. This will be received in IV_SLUG parameter in the DPC method. If you have multiple things to pass you can pass everything in SLUG separated by some separator
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.