download.php
$filepath = '/var/log/messages';
$filesize = filesize($filepath);
$filename = mb_basename($filepath);
$filename = utf2euc($filename);
header("Pragma: public");
header("Expires: 0");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $filesize");
readfile($filepath);
some code...
$filepath = '/var/log/messages';
$filesize = filesize($filepath);
$filename = mb_basename($filepath);
$filename = utf2euc($filename);
header("Pragma: public");
header("Expires: 0");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $filesize");
readfile($filepath);
댓글
댓글 쓰기