Skip to Content

Upload file to HANA server directory

May 10, 2017 at 02:27 PM


avatar image
Former Member

How can I create directory on HANA server to upload local file into there.

I am using SAPUI5 and xsjs to upload shapefile to hana table. The first step I would like to upload local file to HANA server. The second thing is to use statement below to import data:

FROM  [file_path] ....

In other words how to create directory IMPORT statement recognize it.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Thomas Jung
May 15, 2017 at 12:53 PM

As a security feature, XSJS in XSC is not allowed to write to the file system at all. In XSA you can write to the file system, but keep in mind its the XSA Runtime file system (/hana/shared/<SID>/xs/) which might not even be on the same host as the HANA DB itself.

Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Please do not forget to mention: modules have no write access to other module-directories (in XSA). E.G.: if you are using node.js as a JS-Module, you have no permission to write to the web-module and vice versa.

There is no workaround for this ... feature yet.



I am in the same boat, how do we achieve this ?

I have a requirement where a

Rest API periodically provide data from application DB in CSV format.

We have to push this data to Hana DB Tables to build analytics on top..

I am able to achieve the first part, but not sure how do we push it to Hana via http


to push a csv file into HANA, you could create an XS service that gets a post of the file.. parse the file and insert into a table. Thomas has a few examples and there are also some other blogs out there that show this. One caveat may be the size of the file .. you may need to test the payload size of your system... otherwise, you will need an ETL tool such as SAP BODS.