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


PHP SJB_HelperFunctions::getFileSizeAndSizeToken方法代码示例

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


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

示例1: validationManager

 private function validationManager($fieldInfo, $tp, $uploadedFieldId, $complex = null)
 {
     // will use tmp_uploads_storage in $_SESSION to storage file info
     $uniqueStorageId = SJB_Session::getSessionId();
     $this->fileUniqueId = $uniqueStorageId . "_" . $uploadedFieldId . "_tmp";
     // delete uniquie value
     SJB_UploadFileManager::deleteUploadedFileByID($this->fileUniqueId);
     $this->property = new SJB_ObjectProperty($fieldInfo);
     $this->property->setValue('');
     if ($complex) {
         $this->property->setComplexParent($complex['parentField']);
         $this->property->setComplexEnum($complex['complexStep']);
         $fileNamePath = "{$complex['parentField']}/name/{$complex['subFieldId']}/{$complex['complexStep']}";
         $fileSizePath = "{$complex['parentField']}/size/{$complex['subFieldId']}/{$complex['complexStep']}";
     } else {
         $fileNamePath = $uploadedFieldId . '/name';
         $fileSizePath = $uploadedFieldId . '/size';
     }
     $fileName = SJB_Array::getPath($_FILES, $fileNamePath);
     if (!$fileName) {
         $validation = 'UPLOAD_ERR_INI_SIZE';
     } else {
         $uploadedFilesize = SJB_Array::getPath($_FILES, $fileSizePath);
         $filesizeInfo = SJB_HelperFunctions::getFileSizeAndSizeToken($uploadedFilesize);
         $tp->assign(array('filesize' => $filesizeInfo['filesize'], 'size_token' => $filesizeInfo['size_token']));
         $validation = $this->property->isValid();
     }
     $this->propertyValue = $this->property->getValue();
     if ($validation !== true) {
         $this->errors[$validation] = 1;
         if (!$complex) {
             $tp->assign(array('id' => $uploadedFieldId, 'value' => array('file_url' => SJB_Array::get($this->propertyValue, 'file_url'), 'file_name' => SJB_Array::get($this->propertyValue, 'file_name'), 'saved_file_name' => SJB_Array::get($this->propertyValue, 'saved_file_name'), 'file_id' => $this->fileUniqueId)));
         }
     }
     $tp->assign("uploadMaxFilesize", SJB_UploadFileManager::getIniUploadMaxFilesize());
     return $validation === true;
 }
开发者ID:Maxlander,项目名称:shixi,代码行数:37,代码来源:ajax_file_upload_handler.php


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