⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.fdf-get-attachment.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Extracts uploaded file embedded in the FDF</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="function.fdf-get-ap.html">fdf_get_ap</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.fdf-get-encoding.html">fdf_get_encoding</a></div> <div class="up"><a href="ref.fdf.html">FDF Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.fdf-get-attachment" class="refentry"> <div class="refnamediv">  <h1 class="refname">fdf_get_attachment</h1>  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">fdf_get_attachment</span> &mdash; <span class="dc-title">Extracts uploaded file embedded in the FDF</span></p> </div>  <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">array</span> <span class="methodname"><b><b>fdf_get_attachment</b></b></span>    ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$fdf_document</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$fieldname</tt></span>   , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$savepath</tt></span>   )</div>  <p class="para rdfs-comment">   Extracts a file uploaded by means of the &quot;file selection&quot; field   <i><tt class="parameter">fieldname</tt></i> and stores it under   <i><tt class="parameter">savepath</tt></i>.   </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">fdf_document</tt></i></span>     <dd>      <p class="para">       The FDF document handle, returned by <a href="function.fdf-create.html" class="function">fdf_create()</a>,       <a href="function.fdf-open.html" class="function">fdf_open()</a> or <a href="function.fdf-open-string.html" class="function">fdf_open_string()</a>.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">fieldname</tt></i></span>     <dd>      <p class="para">      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">savepath</tt></i></span>     <dd>      <p class="para">       May be the name of a plain file or an existing directory in which the       file is to be created under its original name. Any existing file under       the same name will be overwritten.      </p>      <blockquote><p><b class="note">Note</b>:                There seems to be no other way to find out the original filename but        to store the file using a directory as         <i><tt class="parameter">savepath</tt></i> and check for the basename it was        stored under.       <br />      </p></blockquote>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   The returned array contains the following fields:   <ul class="itemizedlist">    <li class="listitem">     <span class="simpara"><i><tt class="parameter">path</tt></i> - path were the file got stored</span>    </li>    <li class="listitem">     <span class="simpara"><i><tt class="parameter">size</tt></i> - size of the stored file in bytes</span>    </li>    <li class="listitem">     <span class="simpara"><i><tt class="parameter">type</tt></i> - mimetype if given in the FDF</span>    </li>   </ul>  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 Storing an uploaded file</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;$fdf&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fdf_open_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$HTTP_FDF_DATA</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fdf_get_attachment</span><span style="color: #007700">(</span><span style="color: #0000BB">$fdf</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"filename"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"/tmpdir"</span><span style="color: #007700">);<br />&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"The&nbsp;uploaded&nbsp;file&nbsp;is&nbsp;stored&nbsp;in&nbsp;$data[path]"</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>   </div>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.fdf-get-ap.html">fdf_get_ap</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.fdf-get-encoding.html">fdf_get_encoding</a></div> <div class="up"><a href="ref.fdf.html">FDF Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

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