フォルダーを圧縮してそのzipファイルをlaravel4にダウンロードする方法を教えてください。
フォルダを圧縮する必要があります/public/zipfolder/
圧縮後、自動ダウンロードzipfolder.zip
このパッケージをインストールします
https://github.com/codeless/ziparchiveex
へのルート
public function show($id)
{
//echo $id;
# ZipArchive as usual:
$zip = new ZipArchiveEx();
//$zip->open('my.zip', ZIPARCHIVE::OVERWRITE);
# Add whole directory including contents:
$zip->addDir('/public/zipfolder/');
# Only add the contents of the directory, but
# not the directory-entry of "mydir" itself:
//$zip->addDirContents('mydir');
# Close archive (as usual):
$zip->close();
}
そして、私は以下のエラーが発生しました
ZipArchive::addEmptyDir()
: 無効またはユニット化されたZip
オブジェクト