Fix Classe FileUploader

This commit is contained in:
rMontagne
2011-09-13 08:25:52 +00:00
parent 6b3bcd668b
commit aaa3c46161
-13
View File
@@ -129,25 +129,12 @@ class FileUploaderCore
$this->allowedExtensions = $allowedExtensions; $this->allowedExtensions = $allowedExtensions;
$this->sizeLimit = $sizeLimit; $this->sizeLimit = $sizeLimit;
$this->checkServerSettings();
if (isset($_GET['qqfile'])) if (isset($_GET['qqfile']))
$this->file = new qqUploadedFileXhr(); $this->file = new qqUploadedFileXhr();
else else
$this->file = false; $this->file = false;
} }
private function checkServerSettings()
{
$postSize = $this->toBytes(ini_get('post_max_size'));
$uploadSize = $this->toBytes(ini_get('upload_max_filesize'));
if ($postSize < $this->sizeLimit || $uploadSize < $this->sizeLimit)
{
$size = max(1, $this->sizeLimit / 1024 / 1024) . 'M';
die("{'error':".Tools::displayError('increase post_max_size and upload_max_filesize to $size')."}");
}
}
private function toBytes($str) private function toBytes($str)
{ {