Skip to main content
1-Visitor
December 4, 2019
Solved

Write CSV to local folder

  • December 4, 2019
  • 2 replies
  • 3079 views

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.

Best answer by drichter

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

2 replies

1-Visitor
December 4, 2019

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

1-Visitor
December 4, 2019

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.

Lakshmit1-VisitorAuthor
1-Visitor
December 4, 2019

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

drichter1-VisitorAnswer
1-Visitor
December 4, 2019

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