create a zip file on an asp page

Posted on 2009-12-28
Last Modified: 2012-05-08
I need to create an asp page that will return a zip file that I want to dynamically create, containing an image that I pull from a url and some other files that I will want to pull from the server.

something along the lines of:

Response.ContentType = "application/zip"
Response.Buffer = TRUE

set zip server.createobject("some zip component")



Can anyone provide me with some example asp code and a suggestion for a component to use.
Question by:DanM711
    LVL 4

    Expert Comment

    LVL 22

    Expert Comment


    You will have to use a thrid party command line based zip application to zip files using asp. as suggested above, you can use pkzip application for the purpose. But remember following before proceeding

    1. You need to have sufficient permissions at your web server to host thrid party componenets
    2. You should have write permissions in the folder where you are looking to store resulting zip file.

    Ask me if any further details are needed.

    Author Comment

    Thanks, but i'm looking for some example code that will return a zip file, not just create one. So when a user clicks on a link to my asp page it will come up with a open / save dialogue for the zip file straight away.

    And i need a component that will allow me to add files into the zip file i'm creating by specifying urls and file paths.
    LVL 22

    Expert Comment

    please answer my above 2 questions before i provide you a sample code.. without having server access, this logic wont work..
    LVL 12

    Accepted Solution

    The below code will do just that with csASPZip which is available from Chestysoft (  - no need to set the response content type, etc...

    If you use the trial version you simply need to change the 1st line to
    Set Zip = Server.CreateObject("csASPZipFileTrial.MakeZip")
    Set Zip = Server.CreateObject("csASPZipFile.MakeZip")
    Zip.StreamZip ""

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Problem to be resolved in this article Currently, development of website and web application can be done without writing thousands of lines of programming code by hand. Description This can be done through by using a open source framework such …
    I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
    This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now