2009-03-03 17 views

答えて

11

gzencode機能でgzip圧縮を簡単に適用できます。

<? 
header("Content-Disposition: attachment; filename=yourFile.xml.gz"); 
header("Content-type: application/x-gzip"); 

echo gzencode($xmlToCompress); 
+0

私が探していたものとまったく同じです。ありがとう! – pistolshrimp

0

あなたはgzip module利用できていない場合は、このような

<?php 

    system('gzip filename.xml'); 

?> 
1

何か?

<?php 
header('Content-type: application/x-gzip'); 
header('Content-Disposition: attachment; filename="downloaded.gz"'); 
$data = implode("", file('somefile.xml')); 
print(gzencode($data, 9)); //9 is the level of compression 
?> 
関連する問題