Skip to main content
Solved

Password protected zip files


itay
Supporter
Forum|alt.badge.img+17
  • Supporter

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)
View original
Did this help you find an answer to your question?

6 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • 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+17
  • 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+17
  • 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+17
  • Author
  • Supporter
  • January 25, 2017
erik_jan wrote:

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+17
  • Contributor
  • January 25, 2017

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • January 25, 2017
itay wrote:

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.

 

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings