note 63325 added to features.file-upload.put-method
| From: | csg at diatom dot HUMAN_ONLY dot de | Date: | Mon, 20 Mar 2006 10:40:51 +0000 |
| Subject: | note 63325 added to features.file-upload.put-method | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106096@lists.php.net to get a copy of this message | ||
Example 38-5. "Saving HTTP PUT files with PHP 4" does NOT work at least on Apache/2.0.49
(Linux/SuSE), with PHP Version 4.3.4 running as a module. Even replacing "php://stdin"
with "php://input" does work ONLY, IF the HTTP PUT request does contain *the PHP script
itself*(!) as destination resource. (Normally I would expect name of XML resource as destination,
e.g. "testR.xml" in this case.)
To be more clear, here a JavaScript example of forming a working PUT request (no special Apache
configuration regarding PUT/DAV needed!):
req = new XMLHttpRequest();
req.open('PUT', 'loadsave_put.php?XML=testR.xml', false); // or true, if
using a callback function.
...
req.send(content);
Then file "loadsave_put.php" can properly open content of PUT request with (for example)
<?php $c = file_get_contents("php://input"); ?> .
Hopefully this does help someone here.
----
Server IP: 212.124.37.9
Probable Submitter: 84.185.42.87
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/features.file-upload.put-method.php
Edit -- http://master.php.net/note/edit/63325
Del: integrated -- http://master.php.net/note/delete/63325/integrated
Del: useless -- http://master.php.net/note/delete/63325/useless
Del: bad code -- http://master.php.net/note/delete/63325/bad+code
Del: spam -- http://master.php.net/note/delete/63325/spam
Del: non-english -- http://master.php.net/note/delete/63325/non-english
Del: in docs -- http://master.php.net/note/delete/63325/in+docs
Del: other reasons-- http://master.php.net/note/delete/63325
Reject -- http://master.php.net/note/reject/63325
Search -- http://master.php.net/manage/user-notes.php