Skip to main content
Solved

How do I ZIP files when using File Copy Writer?

  • May 1, 2018
  • 1 reply
  • 200 views

fmelizard
Safer
Forum|alt.badge.img+21

File Copy writer is often used in conjunction with Directory and File Pathnames reader to move or copy files from one location to another. Directory and File Pathnames reader returns a list of files in a folder and FileCopy writer will process that list.

File Copy Writer allows you to ZIP the entire target folder by simply adding .zip to the folder name on the Destination File Copy Folder parameter, i.e.: D:\\tmp\\filecopy.zip

But what if you want to ZIP each indivdual file that you copy, rather than the entire folder? This is a little burried in the File Copy writer parameters.To ZIP each file that you copy, you can use the Dataset Fanout on the File Copy writer. Fanout expression:

@Value(path_filename).zip

This is configured in the Navigation tree under the FILECOPY writer node, Fanout expression

I've attached the workspace for FME 2018

Best answer by takashi

Although the same thing, I prefer to use the FeatureWriter since I feel it's more intuitive.

The ZipArchiver from FME Hub could also be helpful in some cases.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

takashi
Celebrity
  • Best Answer
  • May 3, 2018

Although the same thing, I prefer to use the FeatureWriter since I feel it's more intuitive.

The ZipArchiver from FME Hub could also be helpful in some cases.