Correzione minore #912

This commit is contained in:
Dasc3er 2020-12-29 15:45:39 +01:00
parent 7e5e370176
commit b44110cd24
2 changed files with 5 additions and 2 deletions

View File

@ -22,6 +22,7 @@ namespace Models;
use Common\SimpleModelTrait;
use Illuminate\Database\Eloquent\Model;
use Intervention\Image\ImageManagerStatic;
use Util\FileSystem;
class Upload extends Model
{
@ -76,7 +77,7 @@ class Upload extends Model
return null;
}
$model->size = \Util\FileSystem::fileSize($directory.'/'.$filename);
$model->size = FileSystem::fileSize($directory.'/'.$filename);
$model->user()->associate(auth()->getUser());
$model->save();

View File

@ -17,6 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
use Util\FileSystem;
/**
* Classe per la gestione degli upload del progetto.
*
@ -126,7 +128,7 @@ class Uploads
// Registrazione del file
$data['filename'] = $filename;
$data['original'] = $original;
$data['size'] = $source['size'];
$data['size'] = FileSystem::fileSize($directory.'/'.$filename);
self::register($data);
// Operazioni finali