WordPress函数文档check_upload_size()
判断是否超过上传文件最大限制 描述 Determine if uploaded file exceeds sp…
判断是否超过上传文件最大限制
描述
Determine if uploaded file exceeds space quota.
用法
<?php check_upload_size( $file ); ?>
参数
$file
(array) (必填) $_FILES array for a given file.
默认值: None
示例
| 
 1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
 | 
 /* ———————————- 
 * wordpress函数 kim收集 
 * ———————————- */ 
<?php 
$file = check_upload_size( $file );
 
if ( $file[‘error’] != ‘0’ ) {
 
     // The file was too large or has another error.
 
     echo( $file[‘error’] );
 
} else {
 
     // No errors, we can do stuff with $file here.
 
} 
?> 
 | 
注意
- If there is an error and $_POST[‘html-upload’] is not set, this function will call wp_die() to display the error message and a back button.
 
历史
- 添加于 版本 3.0.0
 
- 原文:http://codex.wordpress.org/Function_Reference/check_upload_size
 
类别:WordPress函数文档、 
		本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论功能已经关闭!