2009-03-03 1 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 
?> 
관련 문제