wrappers.ftp.html

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

HTML
151
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>FTP and FTPS</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="wrappers.http.html">HTTP and HTTPS</a></div> <div class="next" style="text-align: right; float: right;"><a href="wrappers.php.html">PHP input/output streams</a></div> <div class="up"><a href="wrappers.html">List of Supported Protocols/Wrappers</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="wrappers.ftp" class="section">  <h2 class="title">FTP and FTPS</h2>  <p class="simpara">PHP 4, PHP 5, PHP 6.  <var class="filename">ftps://</var> since PHP 4.3.0</p>  <ul class="itemizedlist">   <li class="listitem"><span class="simpara"><var class="filename">ftp://example.com/pub/file.txt</var></span></li>   <li class="listitem"><span class="simpara"><var class="filename">ftp://user:password@example.com/pub/file.txt</var></span></li>   <li class="listitem"><span class="simpara"><var class="filename">ftps://example.com/pub/file.txt</var></span></li>   <li class="listitem"><span class="simpara"><var class="filename">ftps://user:password@example.com/pub/file.txt</var></span></li>  </ul>  <p class="simpara">   Allows read access to existing files and creation of new files   via FTP.  If the server does not support passive mode ftp, the   connection will fail.  </p>  <p class="simpara">   You can open files for either reading or writing, but not both   simultaneously.  If the remote file already exists on the ftp   server and you attempt to open it for writing but have not specified   the context option <i>overwrite</i>, the connection   will fail.  If you need to overwrite existing files over ftp,   specify the <i>overwrite</i> option in the context   and open the file for writing.  Alternatively, you can   use the <a href="ref.ftp.html" class="link">FTP extension</a>.  </p>  <blockquote><p><b class="note">Note</b>:    <b>Appending</b><br />   <span class="simpara">    As of PHP 5.0.0 files may be appended via the    <i>ftp://</i> URL wrapper.  In prior versions, attempting    to append to a file via <i>ftp://</i> will result in failure.   </span>  </p></blockquote>  <p class="simpara">   <var class="filename">ftps://</var> was introduced in PHP 4.3.0.   It is the same as <var class="filename">ftp://</var>,   but attempts to negotiate a secure connection with the ftp server.   If the server does not support SSL, then the connection falls back   to regular unencrypted ftp.  </p>  <blockquote><p><b class="note">Note</b>:    <span class="simpara">FTPS is supported starting from PHP 4.3.0, if you    have compiled in support for OpenSSL.   </span>  </p></blockquote>  <p class="para">   <table border="5">    <caption><b>Wrapper Summary</b></caption>    <colgroup>     <thead valign="middle">      <tr valign="middle">       <th colspan="1">Attribute</th>       <th colspan="1">PHP 4</th>       <th colspan="1">PHP 5</th>      </tr>     </thead>     <tbody valign="middle" class="tbody">      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Restricted by <a href="filesystem.configuration.html#ini.allow-url-fopen" class="link">allow_url_fopen</a></td>       <td colspan="1" rowspan="1" align="left">Yes</td>       <td colspan="1" rowspan="1" align="left">Yes</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Allows Reading</td>       <td colspan="1" rowspan="1" align="left">Yes</td>       <td colspan="1" rowspan="1" align="left">Yes</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Allows Writing</td>       <td colspan="1" rowspan="1" align="left">Yes (new files only)</td>       <td colspan="1" rowspan="1" align="left">Yes (new files/existing files with <i><tt class="parameter">overwrite</tt></i>)</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Allows Appending</td>       <td colspan="1" rowspan="1" align="left">No</td>       <td colspan="1" rowspan="1" align="left">Yes</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Allows Simultaneous Reading and Writing</td>       <td colspan="1" rowspan="1" align="left">No</td>       <td colspan="1" rowspan="1" align="left">No</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Supports <a href="function.stat.html" class="function">stat()</a></td>       <td colspan="1" rowspan="1" align="left">No</td>       <td colspan="1" rowspan="1" align="left">        As of PHP 5.0.0: <a href="function.filesize.html" class="function">filesize()</a>,        <a href="function.filetype.html" class="function">filetype()</a>, <a href="function.file-exists.html" class="function">file_exists()</a>,        <a href="function.is-file.html" class="function">is_file()</a>, and <a href="function.is-dir.html" class="function">is_dir()</a> elements only.        As of PHP 5.1.0: <a href="function.filemtime.html" class="function">filemtime()</a>.       </td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Supports <a href="function.unlink.html" class="function">unlink()</a></td>       <td colspan="1" rowspan="1" align="left">No</td>       <td colspan="1" rowspan="1" align="left">Yes</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Supports <a href="function.rename.html" class="function">rename()</a></td>       <td colspan="1" rowspan="1" align="left">No</td>       <td colspan="1" rowspan="1" align="left">Yes</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Supports <a href="function.mkdir.html" class="function">mkdir()</a></td>       <td colspan="1" rowspan="1" align="left">No</td>       <td colspan="1" rowspan="1" align="left">Yes</td>      </tr>      <tr valign="middle">       <td colspan="1" rowspan="1" align="left">Supports <a href="function.rmdir.html" class="function">rmdir()</a></td>       <td colspan="1" rowspan="1" align="left">No</td>       <td colspan="1" rowspan="1" align="left">Yes</td>      </tr>     </tbody>    </colgroup>   </table>  </p> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="wrappers.http.html">HTTP and HTTPS</a></div> <div class="next" style="text-align: right; float: right;"><a href="wrappers.php.html">PHP input/output streams</a></div> <div class="up"><a href="wrappers.html">List of Supported Protocols/Wrappers</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

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