cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding updating BLOB in BTP Cloud Hana DB via CAPM oData V4

vivek_anandhan
Participant
0 Likes
865

Hello Experts,
We have a requirement to upload a file to the Hana DB Table in BTP Cloud. The table is created via CAP Model entity and the field is LargeBinary and annotated as MediaType (pdf).

Based on the CAP Entity, we have created Service file also and the oData V4 is generated successfully.

Now while trying to upload the file via file Uploader UI, the update is not happening.

As a troubleshoot method, we created a standard Fiori List Report and it worked as expected.

We would like to upload the file in our custom Freestyle application which sometimes ended up in Error 413 (request payload too large). The same oData service works from postman as well.

We also tried in two parts, Creating a record with UUID and then update the file with PUT  method. This also did not work as expected.

Attached the CAP, UI5 code etc.

Any help in this regards is highly appreciated.

Best Regards,

Vivek

 

Accepted Solutions (0)

Answers (1)

Answers (1)

david_kunz2
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Viwek,

You need to follow the OData streaming choreography, first you need to create the surrounding instance, then use `PUT` to stream in the large binary. Here you can find more details:
https://cap.cloud.sap/docs/guides/providing-services#creating-a-media-resource

 

Best regards,
David

vivek_anandhan
Participant
0 Likes
Hello David, Good day!! Thanks a lot for your response. We are following the same and the service works as expected, but when we try to code the same in a UI5 app controller this is not working as expected. Is there any sample or example code snippet for handling this scenario in UI5 app?
david_kunz2
Product and Topic Expert
Product and Topic Expert
0 Likes
Maybe some UI5 experts can comment?