473,503 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Downloading multiple files in single zip file

I am developing the project management system.

Each Project:
1. Title, description ... , stored in mysql database
2. Upto ten files (initial description), (name in db, file in file
system)
3. Message board, stored in mysql database (1 file per message, message
in db, file in file system)

I need a link (Download Project) which will download all the project
related files, description, message board in the single zip file.

Please suggest any appropriate method about it.

zlib is installed.

Apr 20 '06 #1
4 5155
You can either dynamically create the project archive everytime a user
requests to download it, which would result in a horrible server load,
or cache the archives and have them updated nightly or whe a project
admin requests an update, for example.

Apr 20 '06 #2

ye*********@gmail.com wrote:
I am developing the project management system.

Each Project:
1. Title, description ... , stored in mysql database
2. Upto ten files (initial description), (name in db, file in file
system)
3. Message board, stored in mysql database (1 file per message, message
in db, file in file system)

I need a link (Download Project) which will download all the project
related files, description, message board in the single zip file.

Please suggest any appropriate method about it.

zlib is installed.


That's a problem that I used as an example in my article about the PHP
stream interface:
http://www.phparch.com/sample.php?mid=42

Apr 20 '06 #3
Hi,

I have used the similar code as listed in the listing 2.txt

------------------------------------------------------
include_once ($path.'includes/flyzip/flyzip.php');
include_once ($path.'includes/flyzip/functions.php');

unset($file_list);

AddFolder(&$file_list, $path."uploads/temp", "projdwnld");

//AddFolder(&$file_list, $path."uploads/temp",
$path."uploads/projdwnld");
//$DEBUG = true;

if(!isset($DEBUG)) {
$zip = new FlyZip($path."uploads/projdwnld/".'proj'.$id.'.zip');
foreach($file_list as $src => $dest) {
$zip->AddFile($dest, $src);
}
$zip->EchoToClient();
} else {
foreach($file_list as $src => $dest) {
copy($src, $dest);
}
}
---------------------------------------------------------------------------------------------

if I use $DEBUG = true, then the files are successfully coped to the
specified download folder. But when it is not set, it prints the output
on the browser window as

PKPz߄fʀprojdwnld/test.txt㥢岴 q
Rqt򱕈HΈ̋)-ΏO..(ʏ*)JLΎ-JЋHKMMIrr‹ӓ€z\\œ2sRʒ‹€z‹4 ŒLʹ􂽼¬y©dvAbI.󑐀Pz߄fʀPKPz߄fʀpro jdwnld/Copy
of test.txt㥢岴 q
Rqt򱕈HΈ̋)-ΏO..(ʏ*)JLΎ-JЋHKMMIrr‹ӓ€z\\œ2sRʒ‹€z‹4 ŒLʹ􂽼¬y©dvAbI.󑐀Pz߄fʀPKPz߄fʀ
projdwnld/test.txtPKPz߄fʀ ¢projdwnld/Copy of test.txtPKˆL
How can I save those files in the single zip file.
I have tested the following code for creation of zip file.

$fname = "proj".$id."-".date("Y-m-d H-i-s").".bz2";
touch($path."uploads/projdwnld/".$fname);
$fp = bzopen($path."uploads/projdwnld/".$fname, "w");
bzwrite($fp, "this is a test");
bzclose($fp);

The abobe code produces the bz2 file.


Chung Leong wrote:
ye*********@gmail.com wrote:
I am developing the project management system.

Each Project:
1. Title, description ... , stored in mysql database
2. Upto ten files (initial description), (name in db, file in file
system)
3. Message board, stored in mysql database (1 file per message, message
in db, file in file system)

I need a link (Download Project) which will download all the project
related files, description, message board in the single zip file.

Please suggest any appropriate method about it.

zlib is installed.


That's a problem that I used as an example in my article about the PHP
stream interface:
http://www.phparch.com/sample.php?mid=42


Apr 21 '06 #4
Thanks.

I was opening the link directly from the browser. Like I tried the link
http://localhost/pms/projects/fulldwnld.php?id=48 in the address bar
and due to it it was giving output as specified in the message.

Later when I checked by clicking on the link "Download", the "File
Download" alert window came and I was able to save the file.

Thanks again.

Manish

Apr 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3041
by: googlinggoogler | last post by:
Hiya, The title says it all really, but im a newbie to python sort of. I can read in files and write files no probs. But what I want to do is read in a couple of files and output them to one...
2
1388
by: Gopal | last post by:
I am using ASP.NET and i wish to push down 3 files (text/xml) from the server to the client. I wish to give the user an option to select the folder in which we wants these files to be dumped. Any...
4
2087
by: KenFehling | last post by:
Hello. I am wondering if there exists a piece of software that takes multiple .js files that are nicely indented and commented and create one big tightly packed .js file. I'm hoping the one file...
1
2049
by: just.starting | last post by:
Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call...
3
2776
by: just.starting | last post by:
Hi, My dot net client downloads files and checks for any new files time to time. The server is apache2.0.53 server. So what happens is that my file download thing works fine if I dont try to call...
5
5943
by: fniles | last post by:
We created an ActiveX control and marked it as safe for scripting using Implements IObjectSafety. We then created a CAB file and signed it using Verisign. We also created a license file (LPK file)...
1
1484
by: Maury | last post by:
Hello, I would like to download multiple files with one click in a web form link, I know how to download a single file, and I think that a solution is to zip all the files in an archive, and then...
6
3960
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
35
9298
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3162
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
377
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.