PHP ile MSOffice için Başlıkları 2007/97 İndir

0 Cevap php

Biz bir müşteri için Zend Framework ile php (blob olarak bir veritabanından servis) yüklenen eklerinizi göndermeye çalışıyoruz.

Bu kod Excel97 / Word97 için çalışıyor.

  if ($this->getResponse()->canSendHeaders(false)) {
            $response = $this->getResponse();

            $response->setHeader('Pragma', 'public', true)
                     ->setHeader('Expires', '0', true)
                     ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true)
                     ->setHeader('Content-Type', 'application/force-download', true)
                     ->setHeader('Content-Type', 'application/octet-stream', true)
                     ->setHeader('Content-Type', 'application/download', true)
                     ->setHeader('Content-Disposition', "attachment;filename=$filename", true)
                     ->setHeader('Content-Transfer-Encoding', 'binary', true)
                     ->setBody($data) // binary
                     ->sendHeaders();
        } 

Ama excel2007 / Word2007 için çalışmıyor. Bu "dosya bir hata var" ve bunu düzeltmek için trys bildirir.

Herhangi bir öneriniz?

0 Cevap