Changeset 20936


Ignore:
Timestamp:
2011/05/18 10:48:17 (13 years ago)
Author:
eccuore
Message:

fixes 1311 ダウンロード機能:Androidファイルのダウンロードに対応(コンテントタイプ分岐とファイル名指定方法変更)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php

    r20920 r20936  
    124124        // SC_DisplayやSC_Responseに大容量ファイルレスポンスが実装されたら移行可能だと思います。 
    125125 
     126        // 拡張子を取得(Android対応 apkは変更や増加の可能性が低いと考えとりあえず固定) 
     127        $extension = pathinfo($realpath, PATHINFO_EXTENSION); 
    126128        //タイプ指定 
    127         header("Content-Type: Application/octet-stream"); 
     129        if($extension=='apk'){ 
     130            // Androidの場合はコンテンツタイプを変更する必要がある 
     131            header("Content-Type: application/vnd.android.package-archive "); 
     132        }else{ 
     133            header("Content-Type: Application/octet-stream"); 
     134        } 
    128135        //ファイル名指定 
    129         header("Content-Disposition: attachment; filename=" . $sdown_filename); 
     136        header('Content-Disposition: attachment; filename="' . $sdown_filename . '"'); 
    130137        header("Content-Transfer-Encoding: binary"); 
    131138        //キャッシュ無効化 
Note: See TracChangeset for help on using the changeset viewer.