1 바이트의 데이터로 인해 내 워드 문서가 손상됩니다. 서버에서 다운로드 할 때 잘 열리지 만 웹에서 강제로 다운로드하면 파일이 1 바이트 크고 손상됩니다. Ive는 내가 "여분의"공간을 위해 얼굴에서 푸른 색 일 때까지 보았다. 창문에 이상하게출력 스트림에서 공백으로 인해 문서가 손상됩니다.
, 나는이 문서가 잘 나오는 복구를 클릭하면 .... 길고 긴 방법으로 문제가 이런 종류의
public function DownloadDocx()
{
$this->_extension = "docx";
$args = func_get_args();
$newName = trim($args[0]);
ob_flush();
if (!empty($newName)) {
$fileName =$_SERVER['DOCUMENT_ROOT'] . '/wills/docs/' .$newName;
} else {
throw new Exception("Invalid document name");
}
if(strstr($_SERVER["HTTP_USER_AGENT"],"MSIE")==false) {
header("Content-type: application/vnd.openxmlformats-officedocument.wordprocessingml.document");
header("Content-Disposition: inline; filename=\"". $newName . '.' . $this->_extension."\"");
header("Content-Length: ".filesize($fileName . '.' . $this->_extension));
} else {
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=\"". $newName . '.' . $this->_extension."\"");
header("Content-Length: ".filesize($fileName . '.' . $this->_extension));
}
header("Expires: Fri, 01 Jan 2010 05:00:00 GMT");
if(strstr($_SERVER["HTTP_USER_AGENT"],"MSIE")==false) {
header("Cache-Control: no-cache");
header("Pragma: no-cache");
}
readfile($fileName . '.' . $this->_extension);
}
Nah의 공간 ... 나는 소스에서 볼 수 있는데, 내 인생에서 찾을 수 있습니다. . – Blake
이것은 해결되었습니다. 나는 처음에는 죽을 때부터 시작하여 바닥으로갔습니다. 도움을 주셔서 감사합니다. – Blake