호스팅 제공 업체가 서버 (데비안)와 PHP (5.2.6에서 5.3.2로)를 업그레이드 한 후 웹 사이트에서 파일 다운로드 스크립트에 문제가 있습니다.PHP 강제 다운로드 - 100MB보다 큰 파일은 단지 약간의 바이트 만 다운로드합니다
class Download_Controller extends Website_Controller
{
public function index()
{
if (isset($_GET['file'])) {
$file = $_GET['file'];
$filORM = ORM::factory('file')->where('filename', $file)->find();
if ($filORM->loaded and $filORM->deleted=='N' and file_exists(APPPATH.'downloads/'.$file)) {
//we can serve file download
$this->auto_render = false;
$filORM->counter = $filORM->counter + 1;
$filORM->save();
$dl = ORM::factory('download');
$dl->download_file_id = $filORM->id;
$dl->created = time();
$dl->country_id = $this->country->id;
$dl->ip = $this->_getRealIpAddr();
$dl->browser = Kohana::user_agent('browser');
$dl->version = Kohana::user_agent('version');
$dl->platform = Kohana::user_agent('platform');
$dl->save();
return download::force(APPPATH.'downloads/'.$file);
}
else {
$this->download_error();
}
}
else {
//else here we load download center UI
$this->section();
}
}
}
내가 Kohana PHP의 프레임 워크를 사용하고 있습니다 : 100메가바이트보다 작은 파일이 잘 다운로드 할 수 있지만 100메가바이트는 같은 156 바이트 파일을 다운로드합니다 다음 큰 파일을 것입니다 ... 여기 내 다운로드 스크립트입니다. 버전 2.3.x.
서버에 대한 액세스 권한이 있습니까? 또는 관리되는 서버입니까? – Stony
ssh 접속 권한이 있습니다. –
156 바이트 파일의 내용은 무엇입니까? 특별한 것? – Maerlyn