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

How to use ExtractZipArchive?

Rishabh345
5-Regular Member

How to use ExtractZipArchive?

Hi All!

I'm currently using Thingworx 8.5.19 version.

The intent is to programmatically (using Thingworx service), unzip a file containing many JSON files, so that we can process the content in the JSON.

Getting below error:
Unable to Invoke Service ExtractZipArchive on SBR.OEMFeed.RawData.Repo : Cannot extract file "Atlas Copco_RawFeed.zip" to target directory "Atlas Copco".

Any lead can be helpful.

1 ACCEPTED SOLUTION

Accepted Solutions
jensc
13-Aquamarine
(To:Rishabh345)

Hello,

 

What does your unzip service look like? 

This is one I am using to extract source control files;

let result = Things["SystemRepository"].ExtractZipArchive({
	path: '/RJP_Extracted/' /* STRING */,
	zipFileName: '/RJP_Import/20230110.zip' /* STRING */
});

Where "path" is where you will extract your files and "zipFileName" is the path to where your zip file is.

 

I have a brief memory that I have also had the same error and it was because the path was not correct.

 

Regards,

Jens

View solution in original post

1 REPLY 1
jensc
13-Aquamarine
(To:Rishabh345)

Hello,

 

What does your unzip service look like? 

This is one I am using to extract source control files;

let result = Things["SystemRepository"].ExtractZipArchive({
	path: '/RJP_Extracted/' /* STRING */,
	zipFileName: '/RJP_Import/20230110.zip' /* STRING */
});

Where "path" is where you will extract your files and "zipFileName" is the path to where your zip file is.

 

I have a brief memory that I have also had the same error and it was because the path was not correct.

 

Regards,

Jens

Announcements