Skip to main content
16-Pearl
March 10, 2025
Solved

Downloading Photos by Date Range as a ZIP in ThingWorx Mashup

  • March 10, 2025
  • 1 reply
  • 1414 views

Hello Community,

 

In our ThingWorx Mashup, we have implemented a date range selection feature. When a user selects a date range and confirms, an Excel file containing the corresponding entries is generated and downloaded.

Each entry includes approximately seven photos, which are stored in the File Repository. I would like to enhance this functionality by allowing users to select a date range and download all the associated photos in a single step. However,  there can be a large number of photos (e.g., 100+), I would prefer to provide them as a ZIP file to streamline the process.

 

My question is:
Is it possible to implement this functionality within a ThingWorx Mashup? If so, what would be the best approach to achieve this?

Any guidance or suggestions would be greatly appreciated!

Thank you.

Best answer by VladimirRosu_116627

Hi @MA8731174 ,

Please find below two things that might help:

  1. First, and most important, photos don't reduce their size when zipped - their format is not easily compressible. Text content is another story - that's heavily compressible.
  2. There is a service called CreateArchive, at the level of the FileRepository. That will allow you to create a zip archive.

1 reply

19-Tanzanite
March 10, 2025

Hi @MA8731174 ,

Please find below two things that might help:

  1. First, and most important, photos don't reduce their size when zipped - their format is not easily compressible. Text content is another story - that's heavily compressible.
  2. There is a service called CreateArchive, at the level of the FileRepository. That will allow you to create a zip archive.
MA873117416-PearlAuthor
16-Pearl
March 11, 2025

Thank you for your response. @VladimirRosu_116627 

My current architecture is structured as follows within the repository:
Repository → lineName → serialNumber → timeStamp → FolderWithName_1 → PICS FILE1, PIC FILE2...

                                                   FolderWithName_2 → PICS FILE1

                                                   FolderWithName_3 → PICS FILE1 

.

.

.

and so on..

 

 

This is how I store images associated with serial numbers. Currently, users can enter a serial number, initiate a download, and retrieve all pictures from the corresponding folders as a ZIP file.

 

However, I believe that implementing a time-range-based download may not be an optimal solution. Given the potential for a large number of images within a specified time frame, such an approach could lead to excessive data transfer in gigabytes, resulting in performance issues and system slowdowns.

 

Would you agree that retrieving images based solely on the serial number is a more efficient and practical approach? This method ensures a manageable dataset while also mitigating the risk of system abuse that could arise from broad time-range queries.

 

Looking forward to your insights.

19-Tanzanite
March 17, 2025

Hi @MA8731174 ,

 

Why would you believe that the number of pictures that the user will download will be less if you implement an approach based on the serial number?

If I look at the way the repository is structured, if you'll retrieve images based on the SN, without providing a time window, then automatically the number of images will be far higher.

 

The typical way to handle processing-heavy time range queries is simply to remove the possibility to provide a large time window. You could limit the time range start date to be max X months in the past, or you could allow only time ranges like "last week, last day" etc, or a combination of both.