note 63325 deleted from features.file-upload.put-method by simp

From: Date: Thu, 30 Mar 2006 01:58:31 +0000
Subject: note 63325 deleted from features.file-upload.put-method by simp
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-106986@lists.php.net to get a copy of this message
Note Submitter: csg at diatom dot HUMAN_ONLY dot de Reason: 0 ---- 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.

« previous php.notes (#106986) next »