title: how to stop asp.net from uploading posted file
body: <p>I'm developing a httpHandler, in my source code if some conditions aren't met i would like to stop uploading file to the server ( for example file extension is not allowed)</p>
  
  <p>When I try to quit <code>ProcessRequest</code> function with <code>return null;</code>, asp.net tries and uploads the file automatically before I quit the httpHandler...</p>
  
  <p>How can I stop asp.net to automatically upload posted files?</p>
  
  <p>Here is the list of thing I've tested so far and no luck:</p>
  
  <pre><code>public void ProcessRequest(HttpContext context) {
      var worker = (HttpWorkerRequest)provider.GetService(typeof(HttpWorkerRequest));
      ..........
      worker.CloseConnection();
      context.Response.End();
      Environment.Exit(0);
      return null;
  }
  </code></pre>