本文整理汇总了PHP中Zend_File_Transfer_Adapter_Http::isFiltered方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_File_Transfer_Adapter_Http::isFiltered方法的具体用法?PHP Zend_File_Transfer_Adapter_Http::isFiltered怎么用?PHP Zend_File_Transfer_Adapter_Http::isFiltered使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_File_Transfer_Adapter_Http
的用法示例。
在下文中一共展示了Zend_File_Transfer_Adapter_Http::isFiltered方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadFileToTempFolderForUser
/**
* Uploads the specified file found in $upload for the specified user
* to the temp folder.
* As of know, only one file per upload is permitted.
* make sure the upload has been filtered and validated before passing it
* to this method
*
* @param Zend_File_Transfer_Adapter_Http $upload
* @param int $userId
*
* @return null if an error occured or Conjoon_Groupware_Files_File_Dto
*
* @throws InvalidArgumentException
* @throws Conjoon_Modules_Groupware_Files_Exception
*/
public function uploadFileToTempFolderForUser(Zend_File_Transfer_Adapter_Http $upload, $userId)
{
$this->_checkArguments(array('userId' => array('value' => &$userId, 'type' => 'int')));
if (count($upload->getFilters()) && !$upload->isFiltered()) {
/**
* @see Conjoon_Modules_Groupware_Files_Exception
*/
require_once 'Conjoon/Modules/Groupware/Files/Exception.php';
throw new Conjoon_Modules_Groupware_Files_Exception("The upload has not been filtered yet.");
}
if (!$upload->isValid()) {
/**
* @see Conjoon_Modules_Groupware_Files_Exception
*/
require_once 'Conjoon/Modules/Groupware/Files/Exception.php';
throw new Conjoon_Modules_Groupware_Files_Exception("The upload has not been validated yet.");
}
// check if only one file is available
if (count(array_keys($upload->getFileInfo())) != 1) {
throw new Conjoon_Modules_Groupware_Files_Exception("Only one file per download permitted.");
}
$fileInfo = array_pop($upload->getFileInfo());
$name = $fileInfo['name'];
$path = $fileInfo['tmp_name'];
$type = $fileInfo['type'];
$tmpFolderId = $this->_getFolderFacade()->getTempFolderIdForUser($userId);
$obj = $this->_getFileFacade()->moveFileToFolderForUserId($path, $tmpFolderId, $userId, $name, $type);
if (!$obj) {
return null;
}
return $obj->getDto();
}