features.file-upload.errors.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 146 行

HTML
146
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Error Messages Explained</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="features.file-upload.html">Handling file uploads</a></div> <div class="next" style="text-align: right; float: right;"><a href="features.file-upload.common-pitfalls.html">Common Pitfalls</a></div> <div class="up"><a href="features.file-upload.html">Handling file uploads</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="features.file-upload.errors" class="sect1">   <h2 class="title">Error Messages Explained</h2>   <p class="simpara">    Since PHP 4.2.0, PHP returns an appropriate error code along with the     file array.  The error code can be found in the     <i>error</i> segment of the file array that is created     during the file upload by PHP. In other words, the error might be     found in <var class="varname"><a href="reserved.variables.files.html" class="classname">$_FILES['userfile']['error']</a></var>.   </p>   <p class="para">    <dl>     <dt>      <span class="term"><b><tt>UPLOAD_ERR_OK</tt></b></span>      <dd>       <p class="para">        Value: 0; There is no error, the file uploaded with success.       </p>      </dd>     </dt>     <dt>      <span class="term"><b><tt>UPLOAD_ERR_INI_SIZE</tt></b></span>      <dd>       <p class="para">        Value: 1; The uploaded file exceeds the        <a href="ini.core.html#ini.upload-max-filesize" class="link">upload_max_filesize</a>         directive in <var class="filename">php.ini</var>.       </p>      </dd>     </dt>     <dt>      <span class="term"><b><tt>UPLOAD_ERR_FORM_SIZE</tt></b></span>      <dd>       <p class="para">        Value: 2; The uploaded file exceeds the <em class="emphasis">MAX_FILE_SIZE</em>         directive that was specified in the HTML form.       </p>      </dd>     </dt>     <dt>      <span class="term"><b><tt>UPLOAD_ERR_PARTIAL</tt></b></span>      <dd>       <p class="para">        Value: 3; The uploaded file was only partially uploaded.       </p>      </dd>     </dt>     <dt>      <span class="term"><b><tt>UPLOAD_ERR_NO_FILE</tt></b></span>      <dd>       <p class="para">        Value: 4; No file was uploaded.       </p>      </dd>     </dt>     <dt>      <span class="term"><b><tt>UPLOAD_ERR_NO_TMP_DIR</tt></b></span>      <dd>       <p class="para">        Value: 6; Missing a temporary folder. Introduced in PHP 4.3.10 and PHP        5.0.3.       </p>      </dd>     </dt>     <dt>      <span class="term"><b><tt>UPLOAD_ERR_CANT_WRITE</tt></b></span>      <dd>       <p class="para">        Value: 7; Failed to write file to disk. Introduced in PHP 5.1.0.       </p>      </dd>     </dt>     <dt>       <span class="term"><b><tt>UPLOAD_ERR_EXTENSION</tt></b></span>       <dd>         <p class="para">           Value: 8; File upload stopped by extension. Introduced in PHP 5.2.0.         </p>       </dd>     </dt>    </dl>   </p>   <blockquote><p><b class="note">Note</b>:          These became PHP constants in PHP 4.3.0.    <br />   </p></blockquote>  </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="features.file-upload.html">Handling file uploads</a></div> <div class="next" style="text-align: right; float: right;"><a href="features.file-upload.common-pitfalls.html">Common Pitfalls</a></div> <div class="up"><a href="features.file-upload.html">Handling file uploads</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?