note 55840 added to features.file-upload.put-method
| From: | gherson at osu1 dot php dot net | Date: | Mon, 15 Aug 2005 09:16:38 +0000 |
| Subject: | note 55840 added to features.file-upload.put-method | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93669@lists.php.net to get a copy of this message | ||
A Case Study: To set up publishing with Netscape 7.2 Composer to Apache/PHP, no need to use CGI
(which I tried unsuccessfully for too long) or to alter Apache's httpd.conf. I needed only to
click Publish As, fill in put2disk.php as the filename (where its contents are the below), and fill
in that file's dir as the "Publishing address".
XAMPP 1.4.14: Apache/2.0.54 (Win32) mod_ssl/2.0.54 OpenSSL/0.9.7g PHP/5.0.4.
<? // filename: put2disk.php.
//file_put_contents ("get_def.out", print_r (get_defined_vars(), TRUE)); // debugging
// Two slurp methods: (a) didn't work, (b) did.
//$stdin_rsc = fopen("php://input", "r");
//$putdata='';
//while ($putdata .= fread($stdin_rsc, 1024)); // a. Hangs the "Publishing..." dialog.
//while (!feof($stdin_rsc)) $putdata.=fread($stdin_rsc, 8192); // b. Worked, but file_get_contents
is faster.
//fclose($stdin_rsc);
// All that's nec:
$putdata=file_get_contents('php://input'); // Not php://stdin! (When the ability to see
error messages isn't available, the doc (this manual page) needs to be more accurate.)
file_put_contents("stdin.out",$putdata);
?>
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.put-method.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55840
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55840&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55840&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55840&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55840&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55840&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55840&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55840&report=yes
Search -- http://master.php.net/manage/user-notes.php