• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

Compress files

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
colemanchow
Asked:
colemanchow
1 Solution
 
lokeshvCommented:
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
 
us111Commented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now