0
私は、ヘッダー経由でzipファイルをダウンロードしてみてください:無効Zipファイルのダウンロード(ヘッダ+ PHP)
$file = '/srv/users/serverpilot/apps/elm/public/dll/files/438de5/file-c117c93c.zip';
$filename = 'file-c117c93c.zip';
if (file_exists($file))
{
$fileName = trim($filename);
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename='.$fileName);
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
ファイル本当のサイズをダウンロードします。しかし、私がダウンロードしたファイルを開くと、ZIPファイルを開くことができません(無効なアーカイブエラー)
何が間違っていますか?
@Pe dro Lobito同じエラー – elize
私のサーバー上でいくつかのソリューションを試しましたが、解決策を見つけることができませんでした。ファイルの内容が '?掘り続ける... –
私の答えをチェック:) –