Question

Protected/encrypted ZIP files for FME Server Download Service


Badge +4

Just for information sharing and if anyone has any ideas to improve, the following shutdown python script creates a password protected zip file that works with the FME Server download service.

This use s 7za.exe located in the Resource Data area.

import subprocess

import os

DirectoryToZip = r'$(FME_SERVER_DEST_DIR)'

outzipfilename = (os.path.splitext(r'$(FME_SERVER_DEST_DIR)')[0])+'_z.zip'

ZipPass = str(FME_MacroValues['ZipPass'])

subprocess.call([r"$(FME_SHAREDRESOURCE_DATA)/7za.exe",'a', outzipfilename, DirectoryToZip ,'-mx9','-p'+ZipPass], stdin=None, stdout=None, stderr=None, shell=False)

os.remove(DirectoryToZip)

os.rename(outzipfilename, DirectoryToZip)


0 replies

Be the first to reply!

Reply