« Last Edit: Nov 13, 2007, 01:49:33 pm by alexro »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #24 on: Nov 13, 2007, 02:09:19 pm »
looks good, does it work without the filter?
Atari ST fan
Posts: 7
42 credits Members referred : 0
« Reply #25 on: Nov 13, 2007, 02:18:23 pm »
Yes, perfectly.
Errors: Warning: Wrong parameter count for in_array() in /home/test.php on line 9
Warning: Cannot modify header information - headers already sent by (output started at /home/test.php:9) in /home/CreateZipFile.inc.php on line 182
Regards, Alex
« Last Edit: Nov 13, 2007, 02:22:52 pm by alexro »
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #26 on: Nov 13, 2007, 02:20:24 pm »
there was an error
must be
if (is_file($directory.$file) && !in_array($file, $excl_files)) {
Atari ST fan
Posts: 7
42 credits Members referred : 0
« Reply #27 on: Nov 13, 2007, 02:24:15 pm »
Now it gives me:
Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/test.php on line 9
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #28 on: Nov 13, 2007, 02:54:20 pm »
the second value must be an array...
Atari ST fan
Posts: 7
42 credits Members referred : 0
« Reply #29 on: Nov 13, 2007, 04:01:30 pm »
I solved the problem, thank you.
Regards, Alex
« Last Edit: Nov 13, 2007, 07:35:40 pm by alexro »
I crack Photoshop!
Posts: 3
18 credits Members referred : 0
« Reply #30 on: Nov 24, 2007, 06:33:01 pm »
I'm not sure what to do with the classes file... im getting this error: Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/public_html/tmp/createzip.php on line 11
Code:
<?php
/** * Class to dynamically create a zip file (archive) * * @author Rochak Chauhan */
class createZip {
public $compressedData = array(); public $centralDirectory = array(); // central directory public $endOfCentralDirectory = "\x50\x4b\x05\x06\x00\x00\x00\x00"; //end of Central directory record public $oldOffset = 0;
/** * Function to create the directory where the file(s) will be unzipped * * @param $directoryName string * */
public function addDirectory($directoryName) { $directoryName = str_replace("\\", "/", $directoryName);
I crack Photoshop!
Posts: 3
18 credits Members referred : 0
« Reply #31 on: Nov 25, 2007, 01:24:07 am »
Ok I don't know much php but I think its this:
Code:
class createZip { public $compressedData = array(); public $centralDirectory = array(); // central directory public $endOfCentralDirectory = "\x50\x4b\x05\x06\x00\x00\x00\x00"; //end of Central directory record public $oldOffset = 0;
It doesn't have a the ( ) part like this one does:
Code:
public function addDirectory($directoryName) {
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #32 on: Nov 25, 2007, 10:09:29 am »
you need PHP5 to run the script
I crack Photoshop!
Posts: 3
18 credits Members referred : 0
oh, well that sucks... is it easy to modify to work with php 4.3.9?
you need to remove the "public , private" keywords and maybe you need to replace some php5 only functions...(better is a modern php5 enabled webserver, php4 will stop the development at the end of this year)
Just another rainy day
Posts: 1
6 credits Members referred : 0
« Reply #35 on: Nov 30, 2007, 04:23:10 am »
hello,
i need step by step instructions for this (noob) - can anyone help?
Do you upload all three files (CreateZipFile.php, CreateZipFileMac.zip.php, exampleScript.php) to any location on your server?
And then what do you do?
Thank You!
EDIT: By the way, i just have a collection of individual files that i want the user to be able to select from (checkboxes?) which would then be added to one zip file for them to download.
« Last Edit: Nov 30, 2007, 04:32:14 am by rw1 »
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7291