<?php
/* PUT data comes in on the stdin stream */
$putdata fopen("php://input""r");

/* Open a file for writing */
$fp fopen("xbel.xml""w");

/* Read the data 8 KB at a time
and write to the file */

while (!feof($putdata))
{
$data fread($putdata8192);
fwrite($fp$data);
}

/* Close the streams and send file creation http code*/
fclose($fp);
fclose($putdata);
header('HTTP/1.1 201 File Created');
?>