on 03-09-2020 7:29 AM
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.
There is no file system API specifically in XSJS. As you said this is XS Advanced, why not use regular Node.js for this part. It can write easily to the file system of the XSA server (not necessarily the same as the file system of the HANA DB in a distributed environment).
https://www.w3schools.com/nodejs/nodejs_filesystem.asp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
11 | |
10 | |
8 | |
8 | |
6 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.