[TYPO3-50-general] PUT, Automatic Argument registration and php://input

Christoph Blömer chbloemer at gmx.net
Tue Mar 17 08:54:30 CET 2009

I'm just implementing the PUT method for my WebDAV package.

To get my file I PUT to the server I use:
$inputStream = fopen("php://input", "r");
$content = stream_get_contents($inputStream);

Somehow this didn't work anymore.

So I found the following part in the Router class:

F3\FLOW3\MVC\Web\Routing\Router Line 243ff:
            case 'PUT' :
                $putArguments = array();
                parse_str(file_get_contents("php://input"), $putArguments);
                foreach ($putArguments as $argumentName => $argumentValue) {
                    echo $argumentName;
                    $request->setArgument($argumentName, $argumentValue);

My problem is if php://input is already read and I can't read it again.
Also the argumentName would be "Hallo_Welt" if I PUT "Hallo Welt"

What happens when I put a bigger file content?
Does this make sense? What the idea behind this part?

It seems it has something to do with the argument registration Robert 
works on.

So how do I get the file contents now?
The first argument gives me currently just the name of the file.


More information about the TYPO3-project-5_0-general mailing list