title: receiving xml files via http post - security
body: <p>I've a basic php script set up on a web server to accept xml files received sent via Http post. So far so good. But I'm wondering about security issues and what other things I would need to be aware of before I could put this live. Has anyone done this beofre and what things I should be aware of?</p>
  
  <p>Basically all I have so far is:</p>
  
  <pre><code>&lt;?php   
  
  header('Content-type: text/xml');
  
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
  {
      $postText=file_get_contents('php://input');
      $datetime=date('ymdHis'); 
      $xmlfile="myfile" . $datetime . ".xml"; 
      $FileHandle=fopen($xmlfile, 'w') or die("can't open file"); 
      fwrite($FileHandle, $postText); 
      fclose($FileHandle);
      echo 
      '&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;cXML&gt;
      &lt;Response&gt;
      &lt;Status code="200" text="OK"&gt;OK&lt;/Status&gt;
      &lt;/Response&gt;
      &lt;/cXML&gt;';
  }
  ?&gt;
  </code></pre>
  
  <p>which just writes the xml files onto the webserver. What checks would I need to be doing etc?</p>
  
  <p>Thanks,</p>