本文整理汇总了PHP中Ftp::octetConverter方法的典型用法代码示例。如果您正苦于以下问题:PHP Ftp::octetConverter方法的具体用法?PHP Ftp::octetConverter怎么用?PHP Ftp::octetConverter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ftp
的用法示例。
在下文中一共展示了Ftp::octetConverter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUploadError
private function checkUploadError($file)
{
if (!isset($file['error'])) {
$this->addError(_('Unknown error.'));
} else {
if ($file['error'] === UPLOAD_ERR_NO_FILE) {
$this->addError(_('No Files has been uploaded.'));
} else {
if ($file['error'] === UPLOAD_ERR_PARTIAL) {
$this->addError(_('The file has been partially uploaded.'));
} else {
if ($file['error'] === UPLOAD_ERR_INI_SIZE) {
$error = _("You can’t upload a file bigger than %d octets.");
$max = Ftp::octetConverter(ini_get('upload_max_filesize'));
$this->addError(sprintf($error, $max));
} else {
if ($file['error'] === UPLOAD_ERR_FORM_SIZE) {
$this->addError(_("The file’s size is bigger than the maximum size " . "specified in the form."));
} else {
if ($file['error'] === UPLOAD_ERR_NO_TMP_DIR) {
$this->addError(_('The temporary directory is missing.'));
} else {
if ($file['error'] === UPLOAD_ERR_CANT_WRITE) {
$this->addError(_("The file can’t be wrote on the disk."));
} else {
if ($file['error'] === UPLOAD_ERR_EXTEMSION) {
$this->addError(_('The file’s extention is not allowed.'));
} else {
$this->addError(_('Unknown error.'));
}
}
}
}
}
}
}
}
}