Skip to main content
Solved

Password protected zip files

  • January 25, 2017
  • 6 replies
  • 127 views

itay
Supporter
Forum|alt.badge.img+18

Hi,

Does anybody know how to create a password protected (encrypted) zip file with FME?

Preferably not using the systemcaller (not that protected...)

Any pythonistas out there with a ready example? @takashi @david_r :)

Cheers,

Itay

Best answer by itay

As expected python + 7z + awesome colleague (thx poosterveen!) provided the solution as a shutdown script:

import subprocess

OutputZipFile = str(FME_MacroValues['OutputZipFile'])
DirectoryToZip = str(FME_MacroValues['DirectoryToZip'])
ZipPass = str(FME_MacroValues['ZipPass'])

subprocess.call([r"C:\Program Files\7-Zip\7z.exe",'a', OutputZipFile , DirectoryToZip ,'-mx9','-p'+ZipPass], stdin=None, stdout=None, stderr=None, shell=False)
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.

6 replies

erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • January 25, 2017

I don't know any FME solution at this moment.

So, I would promote this to an idea.

I see the use, so I will vote for it.


itay
Supporter
Forum|alt.badge.img+18
  • Author
  • Supporter
  • January 25, 2017

Thanks, didn't expect a FME solution, hence the hint for a python solution.


itay
Supporter
Forum|alt.badge.img+18
  • Author
  • Supporter
  • Best Answer
  • January 25, 2017

As expected python + 7z + awesome colleague (thx poosterveen!) provided the solution as a shutdown script:

import subprocess

OutputZipFile = str(FME_MacroValues['OutputZipFile'])
DirectoryToZip = str(FME_MacroValues['DirectoryToZip'])
ZipPass = str(FME_MacroValues['ZipPass'])

subprocess.call([r"C:\Program Files\7-Zip\7z.exe",'a', OutputZipFile , DirectoryToZip ,'-mx9','-p'+ZipPass], stdin=None, stdout=None, stderr=None, shell=False)

itay
Supporter
Forum|alt.badge.img+18
  • Author
  • Supporter
  • January 25, 2017

I don't know any FME solution at this moment.

So, I would promote this to an idea.

I see the use, so I will vote for it.

Done!

 

https://knowledge.safe.com/idea/39057/to-be-able-to-create-password-protected-zipfiles-w.html

 

 


erik_jan
Contributor
Forum|alt.badge.img+23
  • Contributor
  • January 25, 2017

jdh
Contributor
Forum|alt.badge.img+40
  • Contributor
  • January 25, 2017

As expected python + 7z + awesome colleague (thx poosterveen!) provided the solution as a shutdown script:

import subprocess

OutputZipFile = str(FME_MacroValues['OutputZipFile'])
DirectoryToZip = str(FME_MacroValues['DirectoryToZip'])
ZipPass = str(FME_MacroValues['ZipPass'])

subprocess.call([r"C:\Program Files\7-Zip\7z.exe",'a', OutputZipFile , DirectoryToZip ,'-mx9','-p'+ZipPass], stdin=None, stdout=None, stderr=None, shell=False)
How does this substantially differ from using the SystemCaller?

 

In both cases an external program (7-Zip) is called via it's command line.