pollita         Mon Dec  2 00:57:11 2002 EDT

  Modified files:              
    /phpdoc/en/features file-upload.xml 
  Log:
  Doc Bug #14298 and #10307: 
  PUT method changed between PHP3 and PHP4.  Use stdin stream now.
  
  
Index: phpdoc/en/features/file-upload.xml
diff -u phpdoc/en/features/file-upload.xml:1.50 phpdoc/en/features/file-upload.xml:1.51
--- phpdoc/en/features/file-upload.xml:1.50     Tue Jul 16 14:16:01 2002
+++ phpdoc/en/features/file-upload.xml  Mon Dec  2 00:57:11 2002
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.50 $ -->
+<!-- $Revision: 1.51 $ -->
  <chapter id="features.file-upload">
   <title>Handling file uploads</title>
 
@@ -372,7 +372,37 @@
 
   <sect1 id="features.file-upload.put-method">
    <title>PUT method support</title>
+   <para>
+    PUT method support has changed between PHP3 and PHP4.
+    In PHP4, one should use the standard input stream to read
+    the contents of an HTTP PUT.
+    <example>
+     <title>Saving HTTP PUT files with PHP4</title>
+     <programlisting role="php">
+<![CDATA[
+<?php
+/* PUT data comes in on the stdin stream */
+$putdata = fopen("php://stdin","r");
+
+/* Open a file for writting */
+$fp = fopen("myputfile.ext","w");
+
+/* Read the data 1kb at a time
+   and write to the file */
+while ($data = fread($putdata,1024))
+  fwrite($fp,$data);
 
+/* Close the streams */
+fclose($fp);
+fclose($putdata);
+?>
+]]>
+     </programlisting>
+    </example>
+    <note>
+     All documentation below applies to PHP3 only.
+    </note>
+   </para>
    <para>
     PHP provides support for the HTTP PUT method used by clients such
     as Netscape Composer and W3C Amaya.  PUT requests are much simpler



-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to