当前位置: 首页>>代码示例>>PHP>>正文


PHP Actions::checkUserUp方法代码示例

本文整理汇总了PHP中Actions::checkUserUp方法的典型用法代码示例。如果您正苦于以下问题:PHP Actions::checkUserUp方法的具体用法?PHP Actions::checkUserUp怎么用?PHP Actions::checkUserUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Actions的用法示例。


在下文中一共展示了Actions::checkUserUp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: uploadFile

 /**
  * upload file
  *
  * @param string $location where to upload
  * @param string $thename  file name
  * @param string $tempname temp name
  * @param string $tipo     file type
  *
  * @return uploads file
  */
 public static function uploadFile($location, $thename, $tempname, $tipo)
 {
     global $encodeExplorer;
     $extension = File::getFileExtension($thename);
     $filepathinfo = Utils::mbPathinfo($thename);
     $name = Utils::normalizeStr($filepathinfo['filename']) . "." . $extension;
     $upload_dir = $location->getFullPath();
     $upload_file = $upload_dir . $name;
     if (file_exists($upload_file)) {
         Utils::setWarning("<span><i class=\"fa fa-info-circle\"></i> " . $name . " " . $encodeExplorer->getString("file_exists") . "</span> ");
     } else {
         $mime_type = $tipo;
         $clean_file = $upload_dir . FileManager::safeExtension($name, $extension);
         if (!$location->editAllowed() || !$location->isWritable()) {
             Utils::setError("<span><i class=\"fa fa-exclamation-triangle\"></i> " . $encodeExplorer->getString("upload_not_allowed") . "</span> ");
         } elseif (Utils::notList($mime_type, SetUp::getConfig("upload_allow_type")) == true || Utils::inList($extension, SetUp::getConfig("upload_reject_extension")) == true) {
             Utils::setError("<span><i class=\"fa fa-exclamation-triangle\"></i> " . $name . "<strong>." . $extension . "</strong> " . $encodeExplorer->getString("upload_type_not_allowed") . "</span> ");
         } elseif (!is_uploaded_file($tempname)) {
             $encodeExplorer->setErrorString("failed_upload");
         } elseif (!move_uploaded_file($tempname, $clean_file)) {
             $encodeExplorer->setErrorString("failed_move");
         } elseif (Actions::checkUserUp($clean_file) == false) {
             $encodeExplorer->setErrorString("upload_exceeded");
             unlink($clean_file);
         } else {
             chmod($clean_file, 0755);
             //Actions::updateUserSpace($clean_file, true);
             Utils::setSuccess("<span><i class=\"fa fa-check-circle\"></i> " . $name . "</span> ");
             // file successfully uploaded, sending log notification
             Logger::logCreation($location->getDir(true, false, false, 0) . $name, false);
         }
     }
 }
开发者ID:anteknik,项目名称:arsip,代码行数:43,代码来源:class.php


注:本文中的Actions::checkUserUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。