How to Unzip Files in mendix

0
I created a production application it’s based on 3D Sculpture. In that application, customer details and include images convert to Zip file after admin sends it to the production section. After that production, the manager assigns the work to the employee that zip file. first of all employee work is extract to the zip file. after that, he starts the work, immediately sends an email to the customer confirmation. my problem is I didn't know how to extract the zip file in Mendix.So guys help me!!!
asked
2 answers
1

Hi Yasar,
You could check out the Mendix Appstore for a module to to that. It looks the ZipHandling module will do the trick. https://appstore.home.mendix.com/link/app/108292/

Good luck!

answered
1

Hello Yasar,

You can do it in Java using code similar to this:

List<IMendixObject> ZipFiles = new ArrayList<IMendixObject>();
		
		InputStream fileInputStream = Core.getFileDocumentContent(getContext(), InputZipFile.getMendixObject());
		ZipInputStream zis = new ZipInputStream(fileInputStream);
		
		ZipEntry ze;
		while ((ze = zis.getNextEntry()) != null) {
			IMendixObject FD = Core.instantiate(getContext(),flatfileinterface.proxies.ImportExportDocument.getType());
			Core.storeFileDocumentContent(getContext(), FD, zis);
			FD.setValue(getContext(), flatfileinterface.proxies.ImportExportDocument.MemberNames.Name.toString(), ze.getName());
			ZipFiles.add(FD);						
		}

We’ve managed to use this locally and in Cloud v3. Cloud v4 caused some issues so we eventually dropped it.

Hope this is of use, good luck

answered