473,857 Members | 1,836 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 5174
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*********@gma il.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.'include s/flyzip/flyzip.php');
include_once ($path.'include s/flyzip/functions.php') ;

unset($file_lis t);

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

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

if(!isset($DEBU G)) {
$zip = new FlyZip($path."u ploads/projdwnld/".'proj'.$id.'. zip');
foreach($file_l ist as $src => $dest) {
$zip->AddFile($des t, $src);
}
$zip->EchoToClient() ;
} else {
foreach($file_l ist 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ʀp rojdwnld/test.txt㥢岴 q
Rqt򱕈HΈ̋)-ΏO..(ʏ*)JLΎ-JЋHKMMIrr‹ӓ €z\\œ 2sRʒ‹ z‹4ŒLʹ􂽼 ¬y©dvAbI. Pz߄fʀPKP z߄fʀprojdwnl d/Copy
of test.txt㥢岴 q
Rqt򱕈HΈ̋)-ΏO..(ʏ*)JLΎ-JЋHKMMIrr‹ӓ €z\\œ 2sRʒ‹ z‹4ŒLʹ􂽼 ¬y©dvAbI. Pz߄fʀPKP z߄fʀ
projdwnld/test.txtPKP z߄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."up loads/projdwnld/".$fname);
$fp = bzopen($path."u ploads/projdwnld/".$fname, "w");
bzwrite($fp, "this is a test");
bzclose($fp);

The abobe code produces the bz2 file.


Chung Leong wrote:
ye*********@gma il.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
3067
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 single file, but then be able to take this one single file and recreate the files I put into it. Im really at a loss as to how I go about recovering the files?
2
1408
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 idea how can I download these files onto the client in one go? Thanks ~GOpal
4
2123
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 would be less of a burden for the user's browser to download. I guess the final code output by this hypothetical program could maybe even just be on one long line unless that would create problems. Maybe there is some kind of optimal line...
1
2086
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 any page from the server while downloading. If I try to call a single page while downloading a file then the page request goes time out and the server then closes the existing download stream and the client doestn't throw any exception. So many a...
3
2796
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 any page from the server while downloading. If I try to call a single page while downloading a file then the page request goes time out and the server then closes the existing download stream and the client doestn't throw any exception. So many a...
5
5973
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) for it. We use this control on an ASP page. We put the CAB file for the AX control and VBRun60.CAB in the same folder with all the ASP files. When we call the ASP page using any machine with IE 6 SP2 (we tried it with multiple IE6 SP2...
1
1501
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 downloading it, but I'm looking fo another solution, do you think that is is possible another way? Thanks! ..:M:.
6
3995
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 string UID; public string PWD; }
35
9381
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 500000 to 3200000 of a file whose size is say 20MB... how do i request a download which starts directly at 500000th byte... thank u cheers
0
11083
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10394
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9549
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7940
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 presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7104
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5774
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5971
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4191
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3215
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.