1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<!-- $Revision$ -->
3
- <!-- EN-Revision: 04d9aded7bbd447523cf038ddf88e6d7f7e43c53 Maintainer: Gregory Status: ready -->
3
+ <!-- EN-Revision: 3944dc63330edde959cfd3e7d113c999cbec10ff Maintainer: Gregory Status: ready -->
4
4
<!-- CREDITS: dallas, Luffy, mowangjuanzi -->
5
5
<chapter xml : id =" features.file-upload" xmlns =" http://docbook.org/ns/docbook" >
6
6
<title >文件上传处理</title >
@@ -218,8 +218,8 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
218
218
</programlisting >
219
219
</example >
220
220
<para >
221
- File upload progress bar can be implemented using <link
222
- linkend =" session.upload-progress" >Session Upload Progress</link >.
221
+ 文件上传进度条可以使用 <link
222
+ linkend =" session.upload-progress" >Session Upload Progress</link > 来实现。
223
223
</para >
224
224
</sect1 >
225
225
@@ -231,79 +231,10 @@ foreach ($_FILES["pictures"]["error"] as $key => $error) {
231
231
<literal >error</literal > 字段中被找到,也就是
232
232
<varname >$_FILES['userfile']['error']</varname >。
233
233
</simpara >
234
- <para >
235
- <variablelist >
236
- <varlistentry >
237
- <term ><constant >UPLOAD_ERR_OK</constant ></term >
238
- <listitem >
239
- <para >
240
- 其值为 0,没有错误发生,文件上传成功。
241
- </para >
242
- </listitem >
243
- </varlistentry >
244
- <varlistentry >
245
- <term ><constant >UPLOAD_ERR_INI_SIZE</constant ></term >
246
- <listitem >
247
- <para >
248
- 其值为 1,上传的文件超过了 &php.ini; 中
249
- <link linkend =" ini.upload-max-filesize" >upload_max_filesize</link > 选项限制的值。
250
- </para >
251
- </listitem >
252
- </varlistentry >
253
- <varlistentry >
254
- <term ><constant >UPLOAD_ERR_FORM_SIZE</constant ></term >
255
- <listitem >
256
- <para >
257
- 其值为 2,上传文件的大小超过了 HTML 表单中
258
- <emphasis >MAX_FILE_SIZE</emphasis > 选项指定的值。
259
- </para >
260
- </listitem >
261
- </varlistentry >
262
- <varlistentry >
263
- <term ><constant >UPLOAD_ERR_PARTIAL</constant ></term >
264
- <listitem >
265
- <para >
266
- 其值为 3,文件只有部分被上传。
267
- </para >
268
- </listitem >
269
- </varlistentry >
270
- <varlistentry >
271
- <term ><constant >UPLOAD_ERR_NO_FILE</constant ></term >
272
- <listitem >
273
- <para >
274
- 其值为 4,没有文件被上传。
275
- </para >
276
- </listitem >
277
- </varlistentry >
278
- <varlistentry >
279
- <term ><constant >UPLOAD_ERR_NO_TMP_DIR</constant ></term >
280
- <listitem >
281
- <para >
282
- 其值为 6,找不到临时文件夹。
283
- </para >
284
- </listitem >
285
- </varlistentry >
286
- <varlistentry >
287
- <term ><constant >UPLOAD_ERR_CANT_WRITE</constant ></term >
288
- <listitem >
289
- <para >
290
- 其值为 7,文件写入失败。
291
- </para >
292
- </listitem >
293
- </varlistentry >
294
- <varlistentry >
295
- <term ><constant >UPLOAD_ERR_EXTENSION</constant ></term >
296
- <listitem >
297
- <para >
298
- Value: 8; A PHP extension stopped the file upload. PHP does not
299
- provide a way to ascertain which extension caused the file upload to
300
- stop; examining the list of loaded extensions with <function >phpinfo</function > may help.
301
- </para >
302
- </listitem >
303
- </varlistentry >
304
- </variablelist >
305
- </para >
306
- </sect1 >
234
+ <simpara >
235
+ 此错误代码的值是 <constant >UPLOAD_ERR_<replaceable >*</replaceable ></constant > 常量中的一个。
236
+ </simpara >
237
+ </sect1 >
307
238
308
239
<sect1 xml : id =" features.file-upload.common-pitfalls" >
309
240
<title >常见缺陷</title >
0 commit comments