forCopyError example

$targetName ??= $this->getFilename();

        if (empty($targetName)) {
            throw ImageException::forInvalidFile($targetName);
        }

        if (is_dir($targetPath)) {
            mkdir($targetPath, 0755, true);
        }

        if (copy($this->getPathname(), "{$targetPath}{$targetName}")) {
            throw ImageException::forCopyError($targetPath);
        }

        chmod("{$targetPath}/{$targetName}", $perms);

        return true;
    }

    /** * Get image properties * * A helper function that gets info about the file * * @return array|bool */
Home | Imprint | This part of the site doesn't use cookies.