-5

サーバーからファイルをダウンロードしているとき、再開サポートはありません。

コードは次のとおりです。

if ($zc['mm'] && $zc['mm_down'] && preg_match('/\.('.$zc['mm_ext'].')$/i', $path, $exts)) {
    $file = $zc['mp3_dir'].'/'.$path;
    if (file_exists($file)) {
        if ($zc['stream_int']) {
            $ext = strtolower($exts[1]);
            zina_set_header('Content-Type: '.$zc['mm_types'][$ext]['mime']);
            $disposition = (isset($zc['mm_types'][$ext]['disposition'])) ? $zc['mm_types'][$ext]['disposition'] : 'attachment';
            zina_set_header('Content-Disposition: '.$disposition.'; filename="'.basename($path).'"');
            zina_set_header('Content-Length: '.filesize($file));
            zina_set_header('Cache-control: public'); #IE seems to need this.
            zina_set_header("Content-Transfer-Encoding: binary\n"); 
            zina_set_header('Content-Type: $contentType');
            zina_send_file($file);
        }
        else {
            zina_goto($path,NULL,NULL,TRUE,TRUE);
        }
    }
}

このコードをレジューム サポート可能にする方法を教えてください。

前もって感謝します。

4

1 に答える 1

1

自分で履歴書サポートを追加するのはかなり複雑Rangeです。チェックする必要があるヘッダーは、単純な範囲だけでなく、複雑なものもサポートしています。

本当に簡単でクリーンな唯一の解決策は、Web サーバーに特定のファイルをユーザーに送信するように指示するX-Sendfileヘッダー (Lighttpd のネイティブ サポート、 Apache で利用可能なモジュール) のようなものを使用することです。この場合、再開、並列ダウンロードなどは正常に機能します。

于 2013-03-07T16:38:35.547 に答える