私の電子ブックリーダー(Sony PRS-T1)の内蔵ブラウザは、何らかの形で.epubファイルをダウンロードしたくありません。ソニーPRS-T1のブラウザで.epubファイルをダウンロードする
通常、.epubファイルはテキストファイルであるかのように開きます。このPHP-ダウンロードスクリプトで
は私が私のサーバーに格納するファイルをダウンロードするには、ブラウザを強制的に管理:
今<?php
$path = $_GET['path'];
$mimeType = $_GET['mimeType'];
if(!file_exists($path)) {
// File doesn't exist, output error
die('file not found');
} else {
$size = filesize($path);
$file = basename($path);
// Set headers
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=\"$file\"");
header("Content-Type: $mimeType");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $size");
// Read the file from disk
readfile($path);
}
exit();
?>
、「PRS-T1は、ファイルをダウンロードしますが、何らかの理由で私はドンファイル拡張子を.epubから.htmに変更することを理解しています - これは奇妙です。
しかし、正しく実行する方法があるようです。readbeam.comから.epubファイルをダウンロードすると、予想通りに動作します(このヒントはhttp://www.mobileread.com/forums/showthread.php?t=163466です)。
それは、設定と私の違いがありますか?
は、ここで私が使用して放火犯を見つけたものです:
http://tinypic.com/r/2h7pbth/5
あなたは絶対に正しいです!私は今それを解決するために 'urlencode()'を使います:) – speendo
将来の読者のために、これも見てください:http://stackoverflow.com/questions/15123809/force-download-only-displays-in-browser-doesnt-prompt-ダウンロード用#回答-22228190 – gibberish
@gibberish寒天の部分は、他のページの私が見ている必要がありますか? –