cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

how to download multiple files from filerepo?

asuthrave
1-Newbie

how to download multiple files from filerepo?

We are trying to download multiple pdf files from filerepo. How can we perform this action? Is there any service or resources which we can use?

5 REPLIES 5
paic
1-Newbie
(To:asuthrave)

When you use GetFileListingWithLinks, it exposes a URL that allows for downloading the file.

Files will have to be downloaded one at a time, although you could package them in a Zip archive and provide them in a single download.

asuthrave
1-Newbie
(To:paic)

We have a function which loops through the files in the filerepo.


See the code below with the line  "How can I download a file here?"

var params = {

nameMask: "",

path:""

};


// result: INFOTABLE dataShape: FileSystemFileWithLinks

var result = Things["myfilerepo"].GetFileListingWithLinks(params);


for each(var myfile in result.rows)

{

  How can I download a file here?

    logger.warn(myfile.downloadLink);


}




paic
1-Newbie
(To:asuthrave)

You will need to return the download links to a mashup so the user on the client side can click them to initiate the download.

From the server side script you won't be able to initiate a client side download.

asuthrave
1-Newbie
(To:paic)

I am using the downloadlink in the GetFileListingWithLinks(param) and connecting that to Link Widget SourceURL and I was able to download only 1 file but I want to download 1 file at a time if it has multiple files. Is that even possible?

paic
1-Newbie
(To:asuthrave)

If you display it in a Grid you will see the full list of links you are returning.

Top Tags