Uploader/Uploader.php
public function prepare(UploadableInterface $uploadable)
    {
        if ($uploadable->hasFile() || $uploadable->hasKey() || $uploadable->shouldBeRenamed()) {
            $uploadable->setOldPath($uploadable->getPath());
            $uploadable->setPath($this->generatePath($uploadable->guessFilename()));

            // Check source and set size
            // By File
            if ($uploadable->hasFile()) {
                $file = $uploadable->getFile();

                if (!file_exists($file->getRealPath())) {
                    throw new UploadException(sprintf('Source file "%s" does not exists.', $file->getRealPath()));
                }

                $uploadable->setSize(filesize($file->getRealPath()));

            // By Key
            } elseif ($uploadable->hasKey()) {
                $sourceKey = $uploadable->getKey();

                if (!$this->checkKey($sourceKey)) {
                    throw new UploadException(sprintf('Source file "%s" does not exists.', $sourceKey));
                }

                $uploadable->setSize($this->mountManager->getSize($sourceKey));
            }
        }
    }
public function prepare(UploadableInterface $uploadable)
    {
        if ($uploadable->hasFile() || $uploadable->hasKey() || $uploadable->shouldBeRenamed()) {
            $uploadable->setOldPath($uploadable->getPath());
            $uploadable->setPath($this->generatePath($uploadable->guessFilename()));

            // Check source and set size
            // By File
            if ($uploadable->hasFile()) {
                $file = $uploadable->getFile();

                if (!file_exists($file->getRealPath())) {
                    throw new UploadException(sprintf('Source file "%s" does not exists.', $file->getRealPath()));
                }

                $uploadable->setSize(filesize($file->getRealPath()));

            // By Key
            } elseif ($uploadable->hasKey()) {
                $sourceKey = $uploadable->getKey();

                if (!$this->checkKey($sourceKey)) {
                    throw new UploadException(sprintf('Source file "%s" does not exists.', $sourceKey));
                }

                $uploadable->setSize($this->mountManager->getSize($sourceKey));
            }
        }
    }
{@inheritdoc}