Solved

Compress files

Posted on 2002-03-03
2
169 Views
Last Modified: 2008-02-07
Hi all,

  I would like to make a function that can let users download zip file when they click on a link. This zip file actually contains all the files of a directory and i want it to be made automatically.
  Should i use the exec() function? Or any php functions can help me to zip files?
  Also, I am using linux, can I create the zip file in winzip format instead of gzip without installing library?
  Thx!!!
0
Comment
Question by:colemanchow
2 Comments
 
LVL 4

Expert Comment

by:lokeshv
ID: 6838401
if it a zip file then no problme at all

just put the path of that file in link

like

<a href="full_path_of_file">name of file </a>


yes u can create,but  zip/unzip utility is need to be installed on the server , just type zip/unzip to check , is it on your server ?


Hope this will help

Lk:o)
0
 
LVL 8

Accepted Solution

by:
us111 earned 50 total points
ID: 6838930
yes, use the exec function
exec("gzip yourfile");

note that winzip can read & extract the .gz files without any problems.

If you have a folder, the better is to use tar and then create the zip files.
Winzip can untar & unzip files easily


0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
echo button 13 46
Php Array Diff 3 27
How to remove decimals from calculation amount 8 22
uploading multiple image with php 14 19
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

705 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

16 Experts available now in Live!

Get 1:1 Help Now