cancel
Showing results for 
Search instead for 
Did you mean: 

How to write file to a UNIX file system from XSJS?

Hi,

I want to write the xsjs response in a .dat file. I am able to write the response in .dat file and its being downloaded.

This is the below code.

 $.response.setBody(strF);
  $.response.contentType = 'application/vnd.ms-excel; charset=utf-16le';
  $.response.headers.set('Content-Disposition','attachment;filename=POC3.dat');
  $.response.status= $.net.http.OK;

But I want to restrict the download part and write this file "POC3.dat" in UNIX file system.

All these needs to be done through XSJS only. I am using XS advanced.

Any lead would be appreiated.

View Entire Topic
thomas_jung
Developer Advocate
Developer Advocate

Your Linux system administator is going to have to grant access to that file system to your HANA technical user (generally <sid>adm unless they used space isolation during the installation process).

0 Kudos

Hi Thomas,

How to know HANA technical user info from WEBIDE ? Where it will be present and how to get it?

Thanks,

subrahmanya.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can’t get it from the web ide. This is the Linux OS user. Talk to your system admin. They will know the user. They have to login at the os level as this user to perform maintenance.

0 Kudos

Hi Thomas,

As per the SAP team the /INPUT directory has file permissions of 777 meaning all users and groups have access to it.

but still I am facing "access denied" error. Do they need to give permission to the HANA technical user exclusively for us to able to create file?

thanks,

subrahmanya