php 把文件打成压缩包 ,可以去搜下 pclzip
搜很好多地方没有找到对压缩包进行加密操作的。
如果服务器是linux 那么见代码:
$filename="test.csv";
file_put_contents($filePath,"1\t 2\t 3\n1\t 2\t 3\n1\t 2\t 3\n");
//$test = "/bin/bash /usr/local/inonesoft/bin/atest.sh 123 /usr/local/inonesoft/nginx/htdocs/watch/test.zip /usr/local/inonesoft/nginx/htdocs/watch/test.csv";
$test = "ln /usr/local/inonesoft/nginx/htdocs/watch/test.csv /test.csv; /usr/local/inonesoft/bin/atest.sh 123 - /test.csv > /usr/local/inonesoft/nginx/htdocs/watch/test.zip";
exec($test,$array);
atest.sh:
#zip -rP a123 text.zip test.txt
zip -rP $1 $2 $3
--------------------------------------------------------------
ln -s /usr/local/inonesoft/nginx/htdocs/card_file/DS00001388.csv /DS00001388.csv; /usr/local/inonesoft/bin/zip_encryption.sh lecake2013 - /DS00001388.csv > /usr/local/inonesoft/nginx/htdocs/card_file/DS00001388-2013-08-19_14:29:23.zip; rm -rf /DS00001388.csv;