Solved

How do I ZIP files when using File Copy Writer?

  • 1 May 2018
  • 1 reply
  • 28 views

Userlevel 4
Badge +13

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

icon

Best answer by takashi 3 May 2018, 04:41

View original

1 reply

Userlevel 2
Badge +17

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.

Reply