Quantcast
Channel: Chilkat Forum - latest questions
Viewing all articles
Browse latest Browse all 1061

AppendFiles is not invoking?

$
0
0

Hi, I am using the library on a Ruby on Rails project. I used basically the same code as in the example "(Ruby) Create a WinZip compatible AES Encrypted Zip".

Here is the code:

  zip = Chilkat::CkZip.new()
  success = zip.UnlockComponent("Anything for 30-day trial")
    if (success != true)
    @message.encryption_description = zip.lastErrorText() + "\n";
    exit
  else
    @message.encryption_description = "zero sucess!"
  end

  success1 = zip.NewZip("app/encryptedzipfiles/aes.zip")
  if (success1 != true)
    @message.encryption_description = zip.lastErrorText() + "\n";
    exit
  else
    @message.encryption_description = "first success!"
  end

  zip.put_Encryption(4)
  zip.put_EncryptKeyLength(128)
  zip.put_EncryptPassword("password")

  success2 = zip.AppendFiles("app/contents/*", true)
  if (success2 != true)
    @message.encryption_description = zip.lastErrorText() + "\n";
    exit
  else
    @message.encryption_description = "second sucess!"
  end

  success3 = zip.WriteZipAndClose()
  if (success3 != true)
    @message.encryption_description = zip.lastErrorText() + "\n";
    exit
  else
    @message.encryption_description = "third sucess!"
  end

However, after this method is called and I examine the aes.zip it has only 22 bytes, and no files in it to be unzipped.
There are three files under "app/contents/"

Could you provide some information about what could be wrong with this?

Thanks!!!


Viewing all articles
Browse latest Browse all 1061

Trending Articles