0

Excel の書式設定に関連しているように見える、かなり特殊な問題があります。

Laravel 5.0 アプリケーションがあり、maatwebsite Excel ラッパーを使用した Excel 97 (xlsx) ダウンロード機能があります。これは、ローカルの MAMP プラットフォームでも、http:// 接続でデモ サブドメインを使用する CentOS VPS でも正常に動作します。

しかし、アプリケーションを別のフォルダーにデプロイし、同じ VPS の https:// 接続で別のサブドメインによって提供されるように設定すると、次のエラーが発生します。

Excel cannot open this file.
The file format or file extension is not valid. 
Verify that the file has not been corrupted and 
that file extension matches the format of the file.

何が間違っている可能性がありますか?

http:// プロトコルの別のサブドメインの下にある別のフォルダー内の同じサーバー上で、まったく同じコードが機能することに注意してください。

データ関連の問題を排除するために基本的なファイルを作成しようとしましたが、それでも同じエラーが発生します。使用したテスト コードは次のとおりです。

Excel::create('Filename', function($excel) {
    $excel->setTitle('Our new awesome title');
    $excel->setCreator('Maatwebsite')
          ->setCompany('Maatwebsite');
    $excel->setDescription('A demonstration to change the file properties');
})->export('xlsx'); 
4

0 に答える 0