本文整理匯總了PHP中CFileman::GetFileExtension方法的典型用法代碼示例。如果您正苦於以下問題:PHP CFileman::GetFileExtension方法的具體用法?PHP CFileman::GetFileExtension怎麽用?PHP CFileman::GetFileExtension使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CFileman
的用法示例。
在下文中一共展示了CFileman::GetFileExtension方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: strrpos
if(!$io->FileExists($abs_path) && !$io->DirectoryExists($abs_path))
{
$p = strrpos($path, "/");
if($p!==false)
{
$new = "Y";
$filename = substr($path, $p+1);
$path = substr($path, 0, $p);
}
}
$NEW_ROW_CNT = 1;
$arParsedPath = CFileMan::ParsePath(Array($site, $path), true, false, "", false);
$isScriptExt = in_array(CFileman::GetFileExtension($path), CFileMan::GetScriptFileExt());
if (CAutoSave::Allowed())
$AUTOSAVE = new CAutoSave();
//Check access to file
if(
(
strlen($new) > 0 &&
!(
$USER->CanDoOperation('fileman_admin_files') &&
$USER->CanDoFileOperation('fm_create_new_file', $arPath)
)
)
||
(
示例2: CheckFileExtention
public static function CheckFileExtention($strPath = '', $arExt = false)
{
if (!$arExt) {
$arExt = CMedialib::GetMediaExtentions(false);
}
$ext = strtolower(CFileman::GetFileExtension($strPath));
return in_array($ext, $arExt);
}
示例3: array
$path = $io->CombinePath("/", $path);
$arParsedPath = CFileMan::ParsePath(array($site, $path), true);
$abs_path = $DOC_ROOT . $path;
$arPath = array($site, $path);
$bUploaded = false;
$file_name = "";
$strWarning = "";
if ($REQUEST_METHOD == "POST" && strlen($saveimg) > 0 && check_bitrix_sessid()) {
if (!$USER->CanDoOperation('fileman_edit_existent_files') || !$USER->CanDoFileOperation('fm_edit_existent_file', $arPath)) {
$strWarning = GetMessage('FILEMAN_CAN_NOT_WRITE') . "<br>";
} else {
$file_name = CFileman::GetFileName($newfilename);
if (strlen($file_name) <= 0 || $file_name == "none") {
continue;
}
if (!$USER->IsAdmin() && (in_array(CFileman::GetFileExtension($file_name), CFileMan::GetScriptFileExt()) || $file_name[0] == ".")) {
$strWarning .= GetMessage("FILEMAN_UPLOAD_BAD_TYPE") . "\n";
} elseif ($io->FileExists($abs_path . "/" . $file_name)) {
$strWarning = GetMessage("FILEMAN_FILE_EXIST") . "<br>";
} else {
if ($io->Copy($_FILES["imagefile"]["tmp_name"], $abs_path . "/" . $file_name)) {
$bUploaded = true;
$f = $io->GetFile($abs_path . "/" . $file_name);
$f->MarkWritable();
}
}
}
}
if ($bUploaded) {
?>
<script>