Skip to main content
16-Pearl
April 25, 2024
Solved

How to download folder of a repository thing on button click in ThingWorx

  • April 25, 2024
  • 1 reply
  • 1188 views

Hello Everyone,

Good Afternoon,

 

I have a folder named "photos" in a ThingWorx repository Thing which keeps on updating as & when new images are added to it.

 

I wan to download this folder "photos" which contains multiple images on click of a button from Mashup.

 

Can anyone help me out with this.

 

Thanks in advance.

 

Regards,

Aditya Gupta.

Best answer by PaiChung

Haven't done things within ThingWorx for a while, but there are services that can give you the file list and download links for a file repository

GetFileListingWithLinks, then you'll have to execute each appropriate link.

Not 100% sure how to do the last part, sorry.

1 reply

PaiChung22-Sapphire IAnswer
22-Sapphire I
April 25, 2024

Haven't done things within ThingWorx for a while, but there are services that can give you the file list and download links for a file repository

GetFileListingWithLinks, then you'll have to execute each appropriate link.

Not 100% sure how to do the last part, sorry.

16-Pearl
April 26, 2024

Hello,

 

Thank you for your response.

 

The problem with GetFileListingWithLinks service is it provides link for each image which are there inside a folder.

 

Also I tried CreateZipArchive service with which I was able to create a zip folder and then used GetFileListingWithLinks to download the zip but, the problem I am facing is 

 

1. CreateZipArchive service requires inputs(newFileName, path, files), so how to save these inputs as these won't be changing for me. I also tried saveinputset option but after reloading of the ThingWorx the input set is automatically erased.

2. I want to use CreateZipArchive service twice with different sets of inputs, since I want to download two different folders which are present in a repository.

 

Is there any way that I could call two different CreateZipArchive Service continuously with predefined sets of input in ThingWorx.

 

Do you have any idea how should I deal with the above problems.

22-Sapphire I
April 26, 2024

I think links can be triggered with an event in a mashup I think or maybe explore the expressions capabilities.

As far as needing to do things multiple times, again I would recommend looking at what potential event triggers you can use for that.

Worst case might have to be a timer/scheduler