Skip to main content
1-Visitor
Solved

Write CSV to local folder

Hi All,

Using CSV parser extension service WriteCSVFile am storing CSV file in SystemRepository. But my requirement is to save the file to local folder. Is there a way we can achieve this.

 

Thanks in Advance.

 

Regards

Lakshmi.

drichterAnswer
1-Visitor

This will not work. All Services run on server side. There have no access to your local filesystem.

6 replies

1-Visitor

First you create the file in a FileRepository and then you can use the GetFileListingWithLinks-Service of this FileRepository to download the file.

Translate
1-Visitor

Hi,

 

if you want to have an Export in your Mashup.

Use Data Export widget. This will save the CSV in your default browser location (or ask) when you press it.

Translate
Lakshmit1-VisitorAuthor
1-Visitor

Hi, 

Thank you for reply, but I want to avoid extra click for data export. Instead storing in Repository I was trying to save in local folder using below code.

 

var params = {
path: "/Data.csv" /* STRING */,
data: result1 /* INFOTABLE */,

 fileRepository: ??? --- Is there a way we can store in local folder?

// fileRepository: "SystemRepository" /* THINGNAME */,
withHeader: true /* BOOLEAN */
};
// no return
Resources["CSVParserFunctions"].WriteCSVFile(params);

 

Here WriteCSVFile function stores CSV in fileRepository mentioned in params(Here it is SystemRepository).

Translate
drichter1-VisitorAnswer
1-Visitor

This will not work. All Services run on server side. There have no access to your local filesystem.

Translate