Jump to content

How Make compression file

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
bakso

bakso

    Newbie

  • Members
  • Pip
  • 2 posts
Hello all
I'm newbie here

i have a trouble to download some file, coz php didn't consent to download them together.
the way out is make them to gzip/zip file before downloading them.

any example?


thank for any suggest n helping

*/I'm Indonesia
sorry for my poor english

#2
v0id

v0id

    Retired

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,936 posts
Take a look at the reference.

#3
bakso

bakso

    Newbie

  • Members
  • Pip
  • 2 posts
@void
thanks for ur reply, and i try to understand all php.net/zip guide.
But i still confused.

Here is script to check the file
[HIGHLIGHT="PHP"]
<?
include('Connections/ConnReff.php');
if ($_POST['check'])
{
$box=$_POST['list'];
$box_count=count($box);
if($box <=1)
{
echo "<font face='verdana' size='2' color='red'><b>Error : Please check Data</b></font>";
}

else
{

foreach ($box as $kompress)
{
//HERE IS SCRIPT BLOCK TO MAKE ZIP FILE, BUT I CONFUSED WITH THAT


}
}
}
?>


<? include('Connections/ConnReff.php');
mysql_select_db($database_Conn, $ConnReff);
$query_RsList = "SELECT * FROM upload";
$RsList = mysql_query($query_RsList, $ConnReff) or die(mysql_error());
$totalRows_RsList = mysql_num_rows($RsList);
$i=$totalRows_RsList;
?>

<? if ($i != 0)
{ ?>

<form name="form1" method="post" action="">
<table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="3%" height="25"></td>
<td width="3%">No</td>
<td colspan="2">Title</td>
</tr>
<?
$i=1;
while($row_RsList = mysql_fetch_array($RsList))
{
?>
<tr bgcolor="#FFFFFF">
<td height="24"><input type="checkbox" name="list[]" value="<? echo $row_RsList["kode_file"]; ?>"></td>
<td height="24">
<? echo $i;
echo ".";
?>
</td>
<td width="94%"><? echo $row_RsList['title']; ?></a></td>
</tr>
<?
$i++;
}

?>
</table>
<table>
<tr>
<td><input type="submit" name="check" value="Compress"> </td>
</tr>
</table>
</form>

<?
}
elseif ($i == 0)
{
?>
<table width="100%">
<tr>
<td height="23" bgcolor="#F5F5F5"><div align="center">EMPTY NO DATA </div></td>
</tr>
</table>
<?php
}
mysql_free_result($RsList);
?>[/HIGHLIGHT]

#4
Patrick

Patrick

    Programmer

  • Members
  • PipPipPipPip
  • 101 posts
Is this script running somewhere. Can I see some demo because I can't understand how this script is working.

Waiting to hear something.

Thanks a lot.

#5
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts

Patrick said:

Is this script running somewhere. Can I see some demo because I can't understand how this script is working.

Waiting to hear something.

Thanks a lot.

It isn't working...