public function copyWithFile($object, $file) {
        if ($object instanceof \Puzzlout\Framework\Interfaces\IDocument) {
            $object->setFilename($this->GetFileNameToSaveInDatabase($file));
            $fileExists = \Puzzlout\Framework\Core\DirectoryManager::FileExists($this->GetUploadDirectory($object) . "/" . $object->Filename());
            $extensions = $object->ValidExtensions();
            if (is_array($extensions)) {
                $validExtension = $this->CheckExtension($file, $extensions);
            } else {
                $validExtension = true;
            }
            if (!$fileExists && $validExtension) {
                \Puzzlout\Framework\Core\DirectoryManager::CreateDirectory($this->GetUploadDirectory($object));
                $object->setContentSize($this->GetSizeInKb($file));
                $object->setContentType($this->GetExtension($file));

                //LEt's copy the file
                if (copy($file['tmp_name'], $this->GetUploadDirectory($object) . '/' . $object->Filename())) {
                    return parent::add($object);
                }
            } else {
                return -1;
            }
        }
    }