cvs: phpdoc-ru /reference/filesystem/functions file-get-contents.xml file-put-contents.xml fstat.xml is-uploaded-file.xml
| From: | George Miroshnikov | Date: | Fri, 18 Feb 2005 20:02:34 +0000 |
| Subject: | cvs: phpdoc-ru /reference/filesystem/functions file-get-contents.xml file-put-contents.xml fstat.xml is-uploaded-file.xml | ||
| Groups: | php.doc.ru | ||
| Request: | Send a blank email to doc-ru+get-616@lists.php.net to get a copy of this message | ||
freespace Fri Feb 18 15:02:34 2005 EDT
Modified files:
/phpdoc-ru/reference/filesystem/functions file-get-contents.xml
file-put-contents.xml
fstat.xml
is-uploaded-file.xml
Log:
Sync with en.
http://cvs.php.net/diff.php/phpdoc-ru/reference/filesystem/functions/file-get-contents.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-ru/reference/filesystem/functions/file-get-contents.xml diff -u phpdoc-ru/reference/filesystem/functions/file-get-contents.xml:1.5 phpdoc-ru/reference/filesystem/functions/file-get-contents.xml:1.6 --- phpdoc-ru/reference/filesystem/functions/file-get-contents.xml:1.5 Mon Jan 31 12:04:46 2005 +++ phpdoc-ru/reference/filesystem/functions/file-get-contents.xml Fri Feb 18 15:02:34 2005 @@ -1,25 +1,27 @@ <?xml version="1.0" encoding="windows-1251"?> -<!-- EN-Revision: 1.21 Maintainer: tronic Status: ready --> -<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.22 Maintainer: tronic Status: ready --> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.130 --> <refentry id="function.file-get-contents"> <refnamediv> <refname>file_get_contents</refname> <refpurpose>Ïîëó÷èòü ñîäåðæèìîå ôàéëà â âèäå îäíîé ñòðîêè</refpurpose> </refnamediv> - <refsect1> - <title>Îïèñàíèå</title> + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>file_get_contents</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>maxlen</parameter></methodparam> </methodsynopsis> <para> - Äàííàÿ ôóíêöèÿ èäåíòè÷íà ôóíêöèè <function>file</function> ñ òîé òîëüêî - ðàçíèöåé, ÷òî ñîäåðæèìîå ôàéëà âîçâðàùàåòñÿ â ñòðîêå, íà÷èíàÿ ñ - óêàçàííîãî ñìåùåíèÿ <parameter>offset</parameter>. + Äàííàÿ ôóíêöèÿ èäåíòè÷íà ôóíêöèè <function>file</function> ñ òîé òîëüêî + ðàçíèöåé, ÷òî ñîäåðæèìîå ôàéëà âîçâðàùàåòñÿ â ñòðîêå, íà÷èíàÿ ñ + óêàçàííîãî ñìåùåíèÿ <parameter>offset</parameter> è äî + <parameter>maxlen</parameter> áàéòîâ.  ñëó÷àå íåóäà÷è, <function>file_get_contents</function> âåðí¸ò &false;. </para> <para> @@ -28,29 +30,65 @@ ïðîèçâîäèòåëüíîñòè ôóíêöèÿ èñïîëüçóåò àëãîðèòì 'memory mapping' (åñëè ïîääåðæèâàåòñÿ îïåðàöèîííîé ñèñòåìîé). </para> - <note> - <simpara> - Ïàðàìåòð <parameter>offset</parameter> áûë äîáàâëåí â âåðñèè PHP 5.1.0. - </simpara> - </note> - <note> + <note> <para> Åñëè âû îòêðûâàåòå URI ñîäåðæàùèé ñïåöñèìâîëû, òàêèå êàê ïðîáåë, âàì íóæíî çàêîäèðîâàòü URI ïðè ïîìîùè <function>urlencode</function>. </para> - </note> + </note> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.0.0</entry> + <entry> + Äîáàâëåíà ïîääåðæêà êîíòåêñòà. + </entry> + </row> + <row> + <entry>5.1.0</entry> + <entry> + Äîáàâëåíû àðãóìåíòû <parameter>offset</parameter> è + <parameter>maxlen</parameter>. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; ¬e.bin-safe; &tip.fopen-wrapper; - ¬e.context-support; &warn.ssl-non-standard; - <simpara> - Ñì.òàêæå îïèñàíèÿ ôóíêöèé <function>fgets</function>, <function>file</function>, - <function>fread</function>, <function>include</function>, - <function>readfile</function> &listendand; - <function>file_put_contents</function>. - </simpara> - </refsect1> - </refentry> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>file</function></member> + <member><function>fgets</function></member> + <member><function>fread</function></member> + <member><function>readfile</function></member> + <member><function>file_put_contents</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-ru/reference/filesystem/functions/file-put-contents.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-ru/reference/filesystem/functions/file-put-contents.xml diff -u phpdoc-ru/reference/filesystem/functions/file-put-contents.xml:1.3 phpdoc-ru/reference/filesystem/functions/file-put-contents.xml:1.4 --- phpdoc-ru/reference/filesystem/functions/file-put-contents.xml:1.3 Wed Oct 27 04:49:38 2004 +++ phpdoc-ru/reference/filesystem/functions/file-put-contents.xml Fri Feb 18 15:02:34 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="windows-1251"?> -<!-- EN-Revision: 1.4 Maintainer: tronic Status: ready --> -<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.5 Maintainer: tronic Status: ready --> +<!-- $Revision: 1.4 $ --> <refentry id="function.file-put-contents"> <refnamediv> <refname>file_put_contents</refname> @@ -11,7 +11,7 @@ <methodsynopsis> <type>int</type><methodname>file_put_contents</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> - <methodparam><type>mixed</type><parameter>data</parameter></methodparam> + <methodparam><type>mixed</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> @@ -25,11 +25,17 @@ <constant>FILE_USE_INCLUDE_PATH</constant> è/èëè <constant>FILE_APPEND</constant>. Èñïîëüçóéòå <constant>FILE_USE_INCLUDE_PATH</constant> ñ îñòîðîæíîñòüþ. </simpara> - <para> - Òàêæå âû ìîæåòå ïåðåäàòü (îäíîìåðíûé) ìàññèâ â êà÷åñòâå ïàðàìåòðà - <parameter>data</parameter>. Ýòî áóäåò ýêâèâàëåíòíî âûçîâó - <literal>file_put_contents($filename, join('', $array))</literal>. - </para> + <para> + Òàêæå âû ìîæåòå ïåðåäàòü (îäíîìåðíûé) ìàññèâ â êà÷åñòâå ïàðàìåòðà + <parameter>data</parameter>. Ýòî áóäåò ýêâèâàëåíòíî âûçîâó + <literal>file_put_contents($filename, join('', $array))</literal>. + </para> + <para> + Íà÷èíàÿ ñ âåðñèè PHP 5.1.0, âû òàêæå ìîæåòå ïåðåäàâàòü ðåñóðñ ïîòîêà â + êà÷åñòâå àðãóìåíòà <parameter>data</parameter>.  ðåçóëüòàòå îñòàâøèéñÿ + áóôåð ýòîãî ïîòîêà áóäåò ñêîïèðîâàí â óêàçàííûé ôàéë. Ýòî ïîõîæå íà + èñïîëüçîâàíèå <function>stream_copy_to_stream</function>. + </para> ¬e.bin-safe; &tip.fopen-wrapper; <simpara> http://cvs.php.net/diff.php/phpdoc-ru/reference/filesystem/functions/fstat.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-ru/reference/filesystem/functions/fstat.xml diff -u phpdoc-ru/reference/filesystem/functions/fstat.xml:1.2 phpdoc-ru/reference/filesystem/functions/fstat.xml:1.3 --- phpdoc-ru/reference/filesystem/functions/fstat.xml:1.2 Mon Jan 31 12:04:47 2005 +++ phpdoc-ru/reference/filesystem/functions/fstat.xml Fri Feb 18 15:02:34 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="windows-1251"?> -<!-- EN-Revision: 1.9 Maintainer: freespace Status: ready --> -<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.10 Maintainer: freespace Status: ready --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.24 --> <refentry id="function.fstat"> <refnamediv> @@ -68,9 +68,7 @@ </screen> </example> </para> - - ¬e.clearstatcache; - + ¬e.no-remote; </refsect1> http://cvs.php.net/diff.php/phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml diff -u phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml:1.1 phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml:1.2 --- phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml:1.1 Mon Nov 8 05:23:12 2004 +++ phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml Fri Feb 18 15:02:34 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="windows-1251"?> -<!-- EN-Revision: 1.5 Maintainer: freespace Status: ready --> -<!-- $Revision: 1.1 $ --> +<!-- EN-Revision: 1.6 Maintainer: freespace Status: ready --> +<!-- $Revision: 1.2 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.39 --> <refentry id="function.is-uploaded-file"> <refnamediv> @@ -26,6 +26,29 @@ èëè äàæå äðóãèì ïîëüçîâàòåëÿì òîé æå ñèñòåìû. </para> <para> + Äëÿ ïðàâèëüíîé ðàáîòû, ôóíêöèè <function>is_uploaded_file</function> + íóæåí àðãóìåíò âèäà $_FILES['userfile']['tmp_name'], - èìÿ çàêà÷èâàåìîãî + ôàéëà íà êëèåíòñêîé ìàøèíå $_FILES['userfile']['name'] íå ïîäõîäèò. + </para> + <example> + <title>Ïðèìåð èñïîëüçîâàíèÿ ôóíêöèè <function>is_uploaded_file</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { + echo "File ". $_FILES['userfile']['name'] ." uploaded successfully.\n"; + echo "Displaying contents\n"; + readfile($_FILES['userfile']['tmp_name']); +} else { + echo "Possible file upload attack: "; + echo "filename '". $_FILES['userfile']['tmp_name'] . "'."; +} + +?>]]> + </programlisting> + </example> + <para> Ôóíêöèÿ <function>is_uploaded_file</function> äîñòóïíà òîëüêî íà÷èíàÿ ñ âåðñèè PHP 3.0.16 è PHP 4.0.2 äëÿ òðåòüåé è ÷åòâ¸ðòîé ëèíååê ñîîòâåòñòâåííî. Åñëè âàì íåîáõîäèìî èñïîëüçîâàòü áîëåå ðàííèå âåðñèè,
http://cvs.php.net/diff.php/phpdoc-ru/reference/filesystem/functions/file-get-contents.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc-ru/reference/filesystem/functions/file-get-contents.xml diff -u phpdoc-ru/reference/filesystem/functions/file-get-contents.xml:1.5 phpdoc-ru/reference/filesystem/functions/file-get-contents.xml:1.6 --- phpdoc-ru/reference/filesystem/functions/file-get-contents.xml:1.5 Mon Jan 31 12:04:46 2005 +++ phpdoc-ru/reference/filesystem/functions/file-get-contents.xml Fri Feb 18 15:02:34 2005 @@ -1,25 +1,27 @@ <?xml version="1.0" encoding="windows-1251"?> -<!-- EN-Revision: 1.21 Maintainer: tronic Status: ready --> -<!-- $Revision: 1.5 $ --> +<!-- EN-Revision: 1.22 Maintainer: tronic Status: ready --> +<!-- $Revision: 1.6 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.130 --> <refentry id="function.file-get-contents"> <refnamediv> <refname>file_get_contents</refname> <refpurpose>Ïîëó÷èòü ñîäåðæèìîå ôàéëà â âèäå îäíîé ñòðîêè</refpurpose> </refnamediv> - <refsect1> - <title>Îïèñàíèå</title> + <refsect1 role="description"> + &reftitle.description; <methodsynopsis> <type>string</type><methodname>file_get_contents</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> - <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>offset</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>maxlen</parameter></methodparam> </methodsynopsis> <para> - Äàííàÿ ôóíêöèÿ èäåíòè÷íà ôóíêöèè <function>file</function> ñ òîé òîëüêî - ðàçíèöåé, ÷òî ñîäåðæèìîå ôàéëà âîçâðàùàåòñÿ â ñòðîêå, íà÷èíàÿ ñ - óêàçàííîãî ñìåùåíèÿ <parameter>offset</parameter>. + Äàííàÿ ôóíêöèÿ èäåíòè÷íà ôóíêöèè <function>file</function> ñ òîé òîëüêî + ðàçíèöåé, ÷òî ñîäåðæèìîå ôàéëà âîçâðàùàåòñÿ â ñòðîêå, íà÷èíàÿ ñ + óêàçàííîãî ñìåùåíèÿ <parameter>offset</parameter> è äî + <parameter>maxlen</parameter> áàéòîâ.  ñëó÷àå íåóäà÷è, <function>file_get_contents</function> âåðí¸ò &false;. </para> <para> @@ -28,29 +30,65 @@ ïðîèçâîäèòåëüíîñòè ôóíêöèÿ èñïîëüçóåò àëãîðèòì 'memory mapping' (åñëè ïîääåðæèâàåòñÿ îïåðàöèîííîé ñèñòåìîé). </para> - <note> - <simpara> - Ïàðàìåòð <parameter>offset</parameter> áûë äîáàâëåí â âåðñèè PHP 5.1.0. - </simpara> - </note> - <note> + <note> <para> Åñëè âû îòêðûâàåòå URI ñîäåðæàùèé ñïåöñèìâîëû, òàêèå êàê ïðîáåë, âàì íóæíî çàêîäèðîâàòü URI ïðè ïîìîùè <function>urlencode</function>. </para> - </note> + </note> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <para> + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>&Version;</entry> + <entry>&Description;</entry> + </row> + </thead> + <tbody> + <row> + <entry>5.0.0</entry> + <entry> + Äîáàâëåíà ïîääåðæêà êîíòåêñòà. + </entry> + </row> + <row> + <entry>5.1.0</entry> + <entry> + Äîáàâëåíû àðãóìåíòû <parameter>offset</parameter> è + <parameter>maxlen</parameter>. + </entry> + </row> + </tbody> + </tgroup> + </informaltable> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; ¬e.bin-safe; &tip.fopen-wrapper; - ¬e.context-support; &warn.ssl-non-standard; - <simpara> - Ñì.òàêæå îïèñàíèÿ ôóíêöèé <function>fgets</function>, <function>file</function>, - <function>fread</function>, <function>include</function>, - <function>readfile</function> &listendand; - <function>file_put_contents</function>. - </simpara> - </refsect1> - </refentry> + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>file</function></member> + <member><function>fgets</function></member> + <member><function>fread</function></member> + <member><function>readfile</function></member> + <member><function>file_put_contents</function></member> + </simplelist> + </para> + </refsect1> + </refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc-ru/reference/filesystem/functions/file-put-contents.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-ru/reference/filesystem/functions/file-put-contents.xml diff -u phpdoc-ru/reference/filesystem/functions/file-put-contents.xml:1.3 phpdoc-ru/reference/filesystem/functions/file-put-contents.xml:1.4 --- phpdoc-ru/reference/filesystem/functions/file-put-contents.xml:1.3 Wed Oct 27 04:49:38 2004 +++ phpdoc-ru/reference/filesystem/functions/file-put-contents.xml Fri Feb 18 15:02:34 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="windows-1251"?> -<!-- EN-Revision: 1.4 Maintainer: tronic Status: ready --> -<!-- $Revision: 1.3 $ --> +<!-- EN-Revision: 1.5 Maintainer: tronic Status: ready --> +<!-- $Revision: 1.4 $ --> <refentry id="function.file-put-contents"> <refnamediv> <refname>file_put_contents</refname> @@ -11,7 +11,7 @@ <methodsynopsis> <type>int</type><methodname>file_put_contents</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> - <methodparam><type>mixed</type><parameter>data</parameter></methodparam> + <methodparam><type>mixed</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam> <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> </methodsynopsis> @@ -25,11 +25,17 @@ <constant>FILE_USE_INCLUDE_PATH</constant> è/èëè <constant>FILE_APPEND</constant>. Èñïîëüçóéòå <constant>FILE_USE_INCLUDE_PATH</constant> ñ îñòîðîæíîñòüþ. </simpara> - <para> - Òàêæå âû ìîæåòå ïåðåäàòü (îäíîìåðíûé) ìàññèâ â êà÷åñòâå ïàðàìåòðà - <parameter>data</parameter>. Ýòî áóäåò ýêâèâàëåíòíî âûçîâó - <literal>file_put_contents($filename, join('', $array))</literal>. - </para> + <para> + Òàêæå âû ìîæåòå ïåðåäàòü (îäíîìåðíûé) ìàññèâ â êà÷åñòâå ïàðàìåòðà + <parameter>data</parameter>. Ýòî áóäåò ýêâèâàëåíòíî âûçîâó + <literal>file_put_contents($filename, join('', $array))</literal>. + </para> + <para> + Íà÷èíàÿ ñ âåðñèè PHP 5.1.0, âû òàêæå ìîæåòå ïåðåäàâàòü ðåñóðñ ïîòîêà â + êà÷åñòâå àðãóìåíòà <parameter>data</parameter>.  ðåçóëüòàòå îñòàâøèéñÿ + áóôåð ýòîãî ïîòîêà áóäåò ñêîïèðîâàí â óêàçàííûé ôàéë. Ýòî ïîõîæå íà + èñïîëüçîâàíèå <function>stream_copy_to_stream</function>. + </para> ¬e.bin-safe; &tip.fopen-wrapper; <simpara> http://cvs.php.net/diff.php/phpdoc-ru/reference/filesystem/functions/fstat.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc-ru/reference/filesystem/functions/fstat.xml diff -u phpdoc-ru/reference/filesystem/functions/fstat.xml:1.2 phpdoc-ru/reference/filesystem/functions/fstat.xml:1.3 --- phpdoc-ru/reference/filesystem/functions/fstat.xml:1.2 Mon Jan 31 12:04:47 2005 +++ phpdoc-ru/reference/filesystem/functions/fstat.xml Fri Feb 18 15:02:34 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="windows-1251"?> -<!-- EN-Revision: 1.9 Maintainer: freespace Status: ready --> -<!-- $Revision: 1.2 $ --> +<!-- EN-Revision: 1.10 Maintainer: freespace Status: ready --> +<!-- $Revision: 1.3 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.24 --> <refentry id="function.fstat"> <refnamediv> @@ -68,9 +68,7 @@ </screen> </example> </para> - - ¬e.clearstatcache; - + ¬e.no-remote; </refsect1> http://cvs.php.net/diff.php/phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml?r1=1.1&r2=1.2&ty=u Index: phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml diff -u phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml:1.1 phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml:1.2 --- phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml:1.1 Mon Nov 8 05:23:12 2004 +++ phpdoc-ru/reference/filesystem/functions/is-uploaded-file.xml Fri Feb 18 15:02:34 2005 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="windows-1251"?> -<!-- EN-Revision: 1.5 Maintainer: freespace Status: ready --> -<!-- $Revision: 1.1 $ --> +<!-- EN-Revision: 1.6 Maintainer: freespace Status: ready --> +<!-- $Revision: 1.2 $ --> <!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.39 --> <refentry id="function.is-uploaded-file"> <refnamediv> @@ -26,6 +26,29 @@ èëè äàæå äðóãèì ïîëüçîâàòåëÿì òîé æå ñèñòåìû. </para> <para> + Äëÿ ïðàâèëüíîé ðàáîòû, ôóíêöèè <function>is_uploaded_file</function> + íóæåí àðãóìåíò âèäà $_FILES['userfile']['tmp_name'], - èìÿ çàêà÷èâàåìîãî + ôàéëà íà êëèåíòñêîé ìàøèíå $_FILES['userfile']['name'] íå ïîäõîäèò. + </para> + <example> + <title>Ïðèìåð èñïîëüçîâàíèÿ ôóíêöèè <function>is_uploaded_file</function></title> + <programlisting role="php"> +<![CDATA[ +<?php + +if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { + echo "File ". $_FILES['userfile']['name'] ." uploaded successfully.\n"; + echo "Displaying contents\n"; + readfile($_FILES['userfile']['tmp_name']); +} else { + echo "Possible file upload attack: "; + echo "filename '". $_FILES['userfile']['tmp_name'] . "'."; +} + +?>]]> + </programlisting> + </example> + <para> Ôóíêöèÿ <function>is_uploaded_file</function> äîñòóïíà òîëüêî íà÷èíàÿ ñ âåðñèè PHP 3.0.16 è PHP 4.0.2 äëÿ òðåòüåé è ÷åòâ¸ðòîé ëèíååê ñîîòâåòñòâåííî. Åñëè âàì íåîáõîäèìî èñïîëüçîâàòü áîëåå ðàííèå âåðñèè,