mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-24 04:48:55 +00:00

- All id attributes are now xml:id - Add docbook namespace to all root elements - Replace <ulink /> with <link xlink:href /> - Minor markup fixes here and there git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@238160 c90b9560-bf6c-de11-be94-00142212c4b1
123 lines
3.4 KiB
XML
123 lines
3.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.5 $ -->
|
|
<refentry xml:id="function.fdf-get-attachment" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>fdf_get_attachment</refname>
|
|
<refpurpose>Extracts uploaded file embedded in the FDF</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>fdf_get_attachment</methodname>
|
|
<methodparam><type>resource</type><parameter>fdf_document</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>fieldname</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>savepath</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Extracts a file uploaded by means of the "file selection" field
|
|
<parameter>fieldname</parameter> and stores it under
|
|
<parameter>savepath</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>fdf_document</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The FDF document handle, returned by <function>fdf_create</function>,
|
|
<function>fdf_open</function> or <function>fdf_open_string</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>fieldname</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>savepath</parameter></term>
|
|
<listitem>
|
|
<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.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
There seems to be no other way to find out the original filename but
|
|
to store the file using a directory as
|
|
<parameter>savepath</parameter> and check for the basename it was
|
|
stored under.
|
|
</para>
|
|
</note>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
The returned array contains the following fields:
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara><parameter>path</parameter> - path were the file got stored</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><parameter>size</parameter> - size of the stored file in bytes</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><parameter>type</parameter> - mimetype if given in the FDF</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Storing an uploaded file</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$fdf = fdf_open_string($HTTP_FDF_DATA);
|
|
$data = fdf_get_attachment($fdf, "filename", "/tmpdir");
|
|
echo "The uploaded file is stored in $data[path]";
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|