About PHP Compression Tool

Discussion in 'PHP' started by great_friend, Oct 14, 2007.

  1. #1
    I Want TO Use PHP compression Tool Through Which

    Me Upload ( .gif , .Jpg , .SIS) File But When User CLcik On The
    : Download Image : THis Link Downloaded Image Is In Zip Format

    And Renamed

    There Is Any Way To Do This




    Reagrd
    efreesms.com
     
    great_friend, Oct 14, 2007 IP
  2. sea otter

    sea otter Peon

    Messages:
    250
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can do this with the zip function extensions available in PHP: http://us3.php.net/manual/en/ref.zip.php

    Basically, the sequence would be as such:

    1. user uploads file
    2. In your upload processing code you zip up the file and save the zipped version
    3. delete (unlink) the non-zipped image you uploaded
    4. Save the zipped filename as the "download" filename
    5. When a user visits your "download" page with the name of the zip file to download, return that file. The above link has sample code which shows you how to set the correct send headers for downloading zip files.
     
    sea otter, Oct 14, 2007 IP