Fix Classe FileUploader
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user