getObjectData(); if ('Local' != $aObject['engine']) { $sUrl = $oStorage->getFileUrlByRemoteId($sFile); if (!$sUrl) { $sFile = preg_replace("/\.[A-Za-z0-9]+$/", '', $sFile); $sUrl = $oStorage->getFileUrlByRemoteId($sFile); } // Tmp fix for storages renaming in the past if (!$sUrl && 'bx_posts_files' == $sStorageObject && ($oStorage = BxDolStorage::getObjectInstance('bx_posts_covers'))) $sUrl = $oStorage->getFileUrlByRemoteId($sFile); if (!$sUrl) bx_storage_download_error_occured(); else header("Location: " . $sUrl); exit; } if (!$oStorage->download($sRemoteId, $sToken)) { $iError = $oStorage->getErrorCode(); switch ($iError) { case BX_DOL_STORAGE_ERR_FILE_NOT_FOUND: bx_storage_download_error_occured(); exit; case BX_DOL_STORAGE_ERR_PERMISSION_DENIED: bx_storage_download_error_occured('displayAccessDenied'); exit; default: bx_storage_download_error_occured('displayErrorOccured'); exit; } } function bx_storage_download_error_occured($sMethod = 'displayPageNotFound') { require_once(BX_DIRECTORY_PATH_INC . "design.inc.php"); $oTemplate = BxDolTemplate::getInstance(); $oTemplate->$sMethod (); } /** @} */