Download List as zip

0
Hi i added a simple microflow to store images from a list to a zip file. i found zip documents and zip handling on marcetplace and build up this. to make i smal i filtered the list to have only one element (image) as a zip. But everytime i try i get an error when download file is done.       I tried to uncheck Action and create an output type for zip but all this doesn't chenged anyting..   Does somebody know how to download the images as a simple zip file..   Thanks for every help
asked
2 answers
0

The ZIP activity has a little weird parameter configuration. They stopped using the ZIP file parameter, the only way the Java action works is to use the return value, like you did.

 

However, that means you cannot choose the entity it creates. System.FileDocument has no entity access so your download will fail.

 

  • Create your own entity, must be specialization of System.FileDocument
  • To make this easier to read, lets call it MyZipFile, but you're free to name it as you like it.
  • In your microflow, create and commit an object of MyZipFile
  • Use CommunityCommons.DuplicateFileDocument to duplicate the System.FileDocument you got from the ZIP activity to your new MyZipFile object
  • Delete the FileDocument object, you don't need it anymore as you just copied the contents to your new MyZipFile object
  • Set a meaningful file Name on the MyZipFile object, like download.zip
  • Set DeleteAfterDownload to true if you want the file to be deleted as soon as the user has finished downloading it.
  • Use your MyZipFile object in the Download File activity
  • Unless there is another flow where the object gets deleted: You may want to create a little cleanup scheduled event to delete old MyZipFile objects. The user may cancel the download, the download could get interrupted etc. That could leave a MyZipFile object and file behind, causing clutter in your database and file storage
answered
0

Thanks, this solved it.

created an own entitiy with file.document an then everthing worked fine.

Thanks again for your quick help

answered