cancel
Showing results for 
Search instead for 
Did you mean: 

File upload using ODataModel

former_member190457
Contributor
0 Kudos

Hi all,

My HANA table "FILE" has metadata fields (e.g. filename) and a binary field which I'd like to use for file storage i.e. one file for each row.

I'd like to upload files from a UI5 web app: I can expose my table as OData but I'm not sure about the next step.

I would like to create the new record containing the binary data using the create() method from the ODataModel by UI5.

In this example a .xsjs script is used to perform explicit upload, but it does not leverage the ODataModel.

I would highly value if anyone could share any known best practice on how to do this.

Can anyone please assist?

Thanks, regards

Vincenzo

Accepted Solutions (0)

Answers (1)

Answers (1)

kammaje_cis
Active Contributor
0 Kudos

Hi Vincenzo,

What you need is a Media Entity in your OData service.

Read about Media Link Entries/Media Resources within OData.org.

Hana OData designer should have ways to expose media entities.

SAP Netweaver Gateway's way of handling is here. You need to find a similar way within HANA environment.

Regards

Krishna

former_member190457
Contributor
0 Kudos

Thanks for your kind help Krishna.

I am aware of the Media Link / Media Resources and I am not sure about how HANA + UI5 handles that.

Please can anyone shed some light on how to do this?

Thanks, regards

Vincenzo

kammaje_cis
Active Contributor
0 Kudos

This might help you.

http://scn.sap.com/thread/3432162