Link to home
Start Free TrialLog in
Avatar of orik7
orik7

asked on

How to download multiple files (PHP 4)

Hello.
i making my personal web album page.
it already got 7,000+ photos.
i'm going to add a download option for registred usres.
i'm expeting that user will try to download 1-120  JPEG photos when the oppartnity comes.
so,
for this perpuse i know only of the way of ZIPPING the contant and downloading it as a single file. i used to have server problems using that from time to time.
is there any other way for that?
is there any prooved way to use zipping? (for this many files- contant changes rapidly)
thanx. ori.
ASKER CERTIFIED SOLUTION
Avatar of Kiran Paul VJ
Kiran Paul VJ
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of orik7
orik7

ASKER

thanx. taking a look. we'll be in touch.
Avatar of orik7

ASKER

Hello.
i been looking at this yesterday and it looks saficiant and easy to use for me but .. i can't get it to trat working :
getting the error - Fatal error: Cannot instantiate non-existent class: archive_zip in /home/op/public_html/album/extra/zip-test.php on line 5

which is the first row after the include row.
the included file is inculded fine. i've tryed to use differnt dirotorys names/location but no luck.
and still i belive (judging my history) that i got the files hirarcy wrong.
have you tested it your self?
thanx. ori.
hi orik7,
did u install the PEAR library
Avatar of orik7

ASKER

hi. no i did not. but i understood that i can use the php file mentioned there. i've downloeded it. it was named 'PEAR.php' and i changed i to 'archive_zip.php' to mtach the included reqsted file name on exsample script.
thank-you. ori.
maybe some problem.

do this
keep the original PEAR.php file and download this http://pear.php.net/package/Archive_Zip/download

it will contain a file called Zip.php, keep PEAR.php and Zip.php in a pear folder and use
include ('pear/Zip.php'); instead of include ('pear/archive_zip.php');
and try again.
Avatar of orik7

ASKER

kiranvj, hello.
there was not a 'Zip.php' file on your last link. there only one file i think pear file, named : Archive_Zip-0.1.1 which is the same as first link you gave earlier.
ori.
download it and unrar it
hi ori,

download and check this https://filedb.experts-exchange.com/incoming/ee-stuff/4989-zip.zip

I created a zip using a text file and 3 jpg files.
Works like a charm. I tested and uploaded it.

kiranvj
Avatar of orik7

ASKER

HI. i wanted to update about my expriance with that script/lybary.
 so it worked great for me after all.
i had a problem that the downladed files came as the path i gave. meaning ' giving a full path to the photo (/home/user/../) will output the full path and the photo/s will be as they are on that tree.
this "problem" can be very usefull for some needs. as if you belive that the user will need a reference back to where (which folder) the photo where thaken from. i would also welcome this but i was afraid that it will make more bad than good for my avarge user.
in the end i did not used it and used a one called  'PHPZip v1.2 by Sext (sext@neud.net) 2002-11-18'  while there is a much newer version (1.6+) out there i used this one simply becuase i knew it from my past (and had it on my hard drive).
thanx a lot . ori.