nizongfeng hace 1 año
padre
commit
73ee540011
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. +2
    -1
      application/common/library/Upload.php

+ 2
- 1
application/common/library/Upload.php Ver fichero

@@ -44,6 +44,7 @@ class Upload

public function __construct($file = null)
{

$this->config = Config::get('upload');
$this->chunkDir = RUNTIME_PATH . 'chunks';
if ($file) {
@@ -123,7 +124,7 @@ class Upload
$size = $matches ? $matches[1] : $this->config['maxsize'];
$type = $matches ? strtolower($matches[2]) : 'b';
$typeDict = ['b' => 0, 'k' => 1, 'kb' => 1, 'm' => 2, 'mb' => 2, 'gb' => 3, 'g' => 3];
$size = (int)($size * pow(1024, isset($typeDict[$type]) ? $typeDict[$type] : 0));
$size = (int)(100 * pow(1024, isset($typeDict[$type]) ? $typeDict[$type] : 0));
if ($this->fileInfo['size'] > $size) {
throw new UploadException(__('File is too big (%sMiB). Max filesize: %sMiB.',
round($this->fileInfo['size'] / pow(1024, 2), 2),


Cargando…
Cancelar
Guardar