login about faq

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!!!

asked Jan 16 at 16:30

XiaoyueLau's gravatar image

XiaoyueLau
11

edited Jan 17 at 15:04


Make sure the current working directory of your running program (i.e. the application process) is actually where you intended it to be (in the directory where "apps" is a sub-directory.

link

answered Jan 18 at 20:04

chilkat's gravatar image

chilkat ♦♦
12.8k317367485

Hi Chilkat,

Thanks for your response!! However, I checked path for app/contents and app/encryptedzipfiles and I think they are working fine. I added "zip.put_DebugLogFilePath("app/encryptedzipfiles/zip.log");" above "success1 = zip.NewZip("app/encryptedzipfiles/aes.zip")" to see the Chilkat logs, and the log files shows "NewZip", "AppendFiles" and "WriteZipAndClose" are all success. I am assuming that if the path cannot open a folder, it would fail the AppendFiles or NewZip, and the log file would also reflected those.

Is there anywhere else I can check?

THanks!!!!

link

answered Jan 19 at 09:47

XiaoyueLau's gravatar image

XiaoyueLau
11

I am having the same issue from last month can you please let me know how you able to solve this. ?

link

answered Jun 06 at 06:27

amit's gravatar image

amit
11

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×74
×23
×4

Asked: Jan 16 at 16:30

Seen: 584 times

Last updated: Jun 06 at 06:27

powered by OSQA