cancel
Showing results for 
Search instead for 
Did you mean: 

File Upload Service for xlsx not working

saurav_das
Advisor
Advisor
0 Kudos

Hi Experts,

I have a strange issue, i have built a service to upload file content and store the same and then allow the user to download it using the get_stream method.

similar to this tutorial:

Only i have extended the example to store the xstring content into KPRO instead of stroring it into a DB.

The service works fine with jpg and txt files. the problem arises when i use xlsx docs.

I have successfully tested the same using the gateway client and it works for xlsx also but when the same is called using a rest client or form a UI file upload program, no response is returned back.

In case of the gateway client the program uses sap_gui_upload and the xstring which is uploaded is different then the xstring which is received from the rest client upload.

Any suggestion to resolve this issue will be really helpful,

Saurav.

Accepted Solutions (0)

Answers (1)

Answers (1)

EkanshCapgemini
Active Contributor
0 Kudos

Hi Saurav,

Are you sending the proper headers while testing with uploader or rest client?

If it is working fine for jpg files, you need to put a breakpoint in create_stream method and check what is happening for xlsx file.

Regards,

Ekansh

saurav_das
Advisor
Advisor
0 Kudos

I am passing the same headers as with the gateway client only extra header that i am passing is the cxrf token as it is handled in Gateway client itself.

The POST from the rest client is also working and in the create stream i am getting the xstring values which i am saving. The problem is with the get the same is not returned only in case of xlsx.

What i could find is that the value of the xstring that i get in the create stream is different in case of gateway client and the rest client.

I have a FM to just load file from desktop. the xtring value i get from this fm is same as the xtring i get from gateway client.

But in case of rest client the xtrsing has a toaltal different value.