本文整理汇总了PHP中UploadHandler::maxPostSize方法的典型用法代码示例。如果您正苦于以下问题:PHP UploadHandler::maxPostSize方法的具体用法?PHP UploadHandler::maxPostSize怎么用?PHP UploadHandler::maxPostSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UploadHandler
的用法示例。
在下文中一共展示了UploadHandler::maxPostSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
}
return $return;
}
}
// statically set default language vars - an app that needs to customize messages can do so after including this class (only needs to happen once)
UploadHandler::$i18n = array(
'UPLOADHANDLER_ERR_PROCESS_POST_SIZE' => 'POST size of %1$d bytes exceeds the limit set in php.ini#post_max_size of %2$d bytes.',
'UPLOADHANDLER_ERR_PROCESS_NO_INPUT' => 'No file input fields were detected in the POST request.',
'UPLOADHANDLER_ERR_MOVE_EXISTS' => 'Could not move uploaded file "%1$s" to "%2$s" as the destination file already exists and the overwrite option was not set.',
'UPLOAD_ERR_INI_SIZE' => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.',
'UPLOAD_ERR_FORM_SIZE' => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.',
'UPLOAD_ERR_PARTIAL' => 'The uploaded file was only partially uploaded.',
'UPLOAD_ERR_NO_FILE' => 'No file was uploaded.',
'UPLOAD_ERR_NO_TMP_DIR' => 'Missing a temporary folder.',
'UPLOAD_ERR_CANT_WRITE' => 'Failed to write file to disk.',
'UPLOAD_ERR_EXTENSION' => 'File upload stopped by extension.',
);
// statically set some values that do not change throughout the lifetime of a request
UploadHandler::$contentLength = (int)@$_SERVER['CONTENT_LENGTH'];
UploadHandler::$maxPostSize = UploadHandler::iniBytes(ini_get('post_max_size'));
// store this for informational purposes only - php upload support will internally deny uploads which are over this size but client-side code can use this to advise of file size limits
UploadHandler::$uploadMaxFilesize = UploadHandler::iniBytes(ini_get('upload_max_filesize'));
// the lowest of both maxPostSize and uploadMaxFile size determines the maximum size of a single file upload (may not be accurate to the byte since there's some POST overhead if max POST size happens to be smaller than max file size)
UploadHandler::$maxUploadSize = min(UploadHandler::$uploadMaxFilesize, UploadHandler::$maxPostSize);