Skip to Content

Upload file to HANA server directory

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:

IMPORT "Table_Name” AS SHAPEFILE 
FROM  [file_path] ....

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    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.

    Add comment
    10|10000 characters needed characters exceeded

    • 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.