Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7933643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:23:44+00:00 2026-06-03T21:23:44+00:00

I am trying to compress a folder into a .zip file. I’m using the

  • 0

I am trying to compress a folder into a .zip file. I’m using the FZip library. This is what i have so far:

var zip:FZip = new FZip();
zip.addFile("Users/Vincent/Desktop/test/", null);

The folder test on my desktop is the folder i want to compress.

Now i would like to zip that folder and place the zip file on my desktop but they are talking about byteArrays etc. and i have no idea how to do this.
Can someone please help me?enter link description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:23:45+00:00Added an answer on June 3, 2026 at 9:23 pm

    here is a working example, to make it short I used a lot of anonymous functions.

    package {
    import deng.fzip.FZip;
    
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.FileReference;
    import flash.net.FileReferenceList;
    import flash.utils.ByteArray;
    
    public class ZipTest extends Sprite {
        private var imageRefList : FileReferenceList = new FileReferenceList();
        private var saveRef : FileReference = new FileReference();
        private var zipName : String = "someName.zip";
    
        public function ZipTest() {
            var someButton : Sprite = new Sprite();
            with(someButton.graphics) {
                beginFill(0x00ff00);
                drawRect(0, 0, 50, 50);
                endFill();
            }
            addChild(someButton).addEventListener(MouseEvent.CLICK, function(event : MouseEvent) : void {
                var saveZip : Function = function(zip : FZip) : void {
                    var out : ByteArray = new ByteArray();
                    zip.serialize(out);
    
                    saveRef.addEventListener(Event.COMPLETE, function(e : Event) : void {
                        trace("done");
                    });
                    saveRef.save(out, zipName);
                };
    
                imageRefList.addEventListener(Event.SELECT, function(e : Event) : void {
                    var zip : FZip = new FZip();
                    var count : int = imageRefList.fileList.length;
                    for each (var image: FileReference in imageRefList.fileList) {
                        image.addEventListener(Event.COMPLETE, function(e : Event) : void {
                            var img : FileReference = FileReference(e.target);
                            trace(count + " loaded... " + img.name);
                            zip.addFile(img.name, img.data);
    
                            count--;
                            if (count == 0) saveZip(zip);
                        });
                        trace("load: " + image.name);
                        image.load();
                    }
                });
                imageRefList.browse();
            });
        }
    }
    

    }

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to save (compress) a .zip file using JclCompression with the JCL
I'm trying to automatically compress both CSS and JS using maven and this plugin
I am trying to Compress and Archive all the files in a folder, using
I am trying to compress an AVI file using Visual Basic 6.0 but having
I have been trying to compress and store a json encoded string into mysql,
I'm having a hard time trying to tar some files using the compress library.
I am trying to compress multiple files into a single zip archive and I
I'm trying to make a method of compressing file using Ionic.Zip.dll of DotNetZip. Code
I'm trying to using filtering_streams to compress the serialization of some object into an
I am trying to compress one folder on my local disk, for example: C:\Templates

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.