public function saveToCdn($sFilename, $sBucket = null)
    {
        if (Components::exists('nails/module-cdn')) {

            //  Save temporary file
            $sCacheDir  = CACHE_PATH;
            $sCacheFile = 'TEMP-PDF-' . md5(uniqid() . microtime(true)) . '.pdf';
            if ($this->save($sCacheDir, $sCacheFile)) {

                $oCdn    = Factory::service('Cdn', 'nails/module-cdn');
                $oResult = $oCdn->objectCreate(
                    $sCacheDir . $sCacheFile,
                    $sBucket,
                    ['filename_display' => $sFilename]
                );

                if ($oResult) {

                    @unlink($sCacheDir . $sCacheFile);
                    $this->reset();
                    return $oResult;

                } else {
                    $this->setError($oCdn->lastError());
                    return false;
                }

            } else {
                return false;
            }

        } else {
            $this->setError('CDN module is not available');
            return false;
        }
    }