COM is an OLD Technology and doesnt work well... even Microsoft doesnt recommend the usage of COM these days.

I would recommend you look at java.util.Zip package and this is very compatible with CFMX.

http://java.sun.com/j2se/1.4.1/docs/api/java/util/zip/package-summary.html

If you are not familar with Java, you can probably find some JavaBeans/Classes
already written on google.com or search sun Java forums.

HTH

Joe Eugene
  ----- Original Message -----
  From: David Ashworth
  To: CF-Talk
  Sent: Tuesday, February 10, 2004 11:56 AM
  Subject: accessing COM objects using Coldfusion

  Hello,

  I have installed the component "aspZip.EasyZIP" that is used to unzip
  files, here is the code in ASP:

  const AddDirNames     = 1
  const AddZipTime   = 2
  const AddRecurseDirs  = 4
  const AddHiddenFiles  = 8
  const AddEncrypt    = 16
  const AddSeparateDirs = 32

  dim ZIP, zipItem1

  set ZIP = server.createobject("aspZip.EasyZIP")

  Zip.Debug = true
  Zip.ZipFileName = Server.MapPath("Tcg_divi.zip")
  Zip.ArgsAdd("*.*")
  Zip.ExtrbaseDir = "D:\INETPUB\WWWROOT\ZIP\"
  Zip.ExtrOptions = 1
  Zip.UnZip
  response.Write "Files UnZipped=" & Zip.SuccessCNT & " with Error="&
  Zip.Error & " message=" & Zip.LastMessage

  However, I want to recreate this in Coldfusion, but keep running into
  errors, the code I have developed is as follows:

  <cftry>
  <cfobject action="" class="aspZip.EasyZIP" name="cfmzipper"
  type="com">

  <cfcatch>
    <cfobject action="" class="aspZip.EasyZIP" name="cfmzipper"
  type="com">
  </cfcatch>

  </cftry>

  <cfset AddDirNames = 1>
  <cfset AddZipTime = 2>
  <cfset AddRecurseDirs = 4>
  <cfset AddHiddenFiles = 8>
  <cfset AddEncrypt = 16>
  <cfset AddSeparateDirs = 32>

  <cfscript>
  cfmzipper.Debug = true;
  cfmzipper.ZipFileName = "D:\INETPUB\WWWROOT\ZIP\Tcg_divi.zip";
  cfmzipper.ArgsAdd("*.*");
  cfmzipper.ExtrbaseDir = "D:\INETPUB\WWWROOT\ZIP\";
  cfmzipper.ExtrOptions = 1;
  cfmzipper.UnZip;
  </cfscript>

  Now I know that the debug property etc are being recognised as if I
  change the name slightly, I am told that is not a recognised method.

  The error message I am getting is:

  Error Diagnostic Information

  The error occurred while processing an element with a general identifier
  of (CFSCRIPT), occupying document position (26:1) to (26:10) in the
  template file D:\INETPUB\WWWROOT\ZIP\test.cfm.

  Anyone know where I am going wrong?

  Thanks in advance

  Dave
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to