Search code examples
ruby-on-railszip

Generating password protected zip files from ruby on rails


Has anyone had any luck creating password protected zip files in rails?

I spent a bunch of hours trying to get Chilkat's 64 bit linux gem working on OSX. I got it listed as installed in my gem list, but I was never able to instantiate anything.

I'm on 1.9.2, 3.2.3, OSX.

Thanks in advance!


Solution

  • Have you tried ZipRuby? It seems to have an encryption method.

    Zip::Archive.encrypt('filename.zip', 'password')
    

    Sorry haven't tried it myself so can't be absolutely sure.