Skip to main content
12-Amethyst
April 7, 2022
Solved

Create a service which initiates a download of a CSV file to your Local (Not To Server)

  • April 7, 2022
  • 1 reply
  • 1199 views

Is it possible to create a service, which initiates download to my local directory?

So far I see only an option to write a service to download/write CSV file to server as below:

 

let params = {
path: "anyPath" /* STRING */,
data: anyInfotable /* INFOTABLE */,
fileRepository: "SystemRepository" /* THINGNAME */,
withHeader: true /* BOOLEAN */
};

Resources["CSVParserFunctions"].WriteCSVFile(params);
Best answer by PaiChung

When you run GetFileListingWithLinks on a repository, you'll get a link that can be used to download the file.

But you must make sure to execute the link client side (ie in a mashup)

I believe a 'link' widget should be able to do this for you.

1 reply

PaiChung22-Sapphire IAnswer
22-Sapphire I
April 7, 2022

When you run GetFileListingWithLinks on a repository, you'll get a link that can be used to download the file.

But you must make sure to execute the link client side (ie in a mashup)

I believe a 'link' widget should be able to do this for you.

12-Amethyst
April 8, 2022

where can I find the service GetFileListingwithLinks? I can't find it either in Snippets or in Me/Entities 😞

nikkolasep_0-1649414319144.png

 

14-Alexandrite
April 8, 2022

Hello,

 

You will find it on a repository thing:

// result: INFOTABLE dataShape: "FileSystemFileWithLinks"
let result = Things["SystemRepository"].GetFileListingWithLinks({
	path: undefined /* STRING */,
	nameMask: undefined /* STRING */
});