• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

using ZipCfc

New Here ,
Apr 16, 2006 Apr 16, 2006

Copy link to clipboard

Copied

I am trying to use the zipcfc I got from the CF exchange without any success other then empty zipfiles.
My site is at d:\inetpub\wwwroot\demo_site
The zipcfc is in my custom tags folder

Could someone show me how I call the zip component and recurse all the directories and files under the demo_site folder.

I am relatively new to 6.1, but have used CF since version 3.
TOPICS
Getting started

Views

243

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2006 Apr 16, 2006

Copy link to clipboard

Copied

LATEST
1) I don't think you need to have the file zip.cfc in the custom tags folder. Create the folder myCFCs in d:\inetpub\wwwroot\demo_site.

2) Copy the file zip.cfc from the custom tags folder to the folder myCFCs.

3) Save the following code in d:\inetpub\wwwroot\demo_site as the file zipper.cfm

<cfscript>
/* Create an instance of a component object */
zip = CreateObject("component", "myCFCs.Zip");
/* Add files to Zip file */
status = zip.AddFiles(zipFilePath="d:\inetpub\wwwroot\demo_site\demo_site_zipped.zip", directory="d:\inetpub\wwwroot\demo_site\", recurse="yes");
</cfscript>

4) Run zipper.cfm


There is a warning. The directory should not contain many subdirectories and files. If the directory demo_site contains even a dozen or so directories and subdirectories, several layers deep, the component may cause your computer to hang. More on that in the website of the author (Flash required).


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation