title: Downloadlink for a file dynamically created by a Trac- Wikimacro
body: <p>I've been given the task to write a plugin for Trac.
  It should provide burndown data for the ticketcount and estimations filed in the issue tracking system. 
  The user writes his request as a wikimacro and is provided a link/ button for downloading the burndown as a csv-file, output as a chart is also planned, but has lower priority.</p>
  
  <p>I've got a working solution for processing the data but I'm left with the following problem. </p>
  
  <p><strong>My Question</strong></p>
  
  <p>How can I provide a downloadlink/- button on the Wikipage for a file which is dynamically created by the users request? </p>
  
  <p>I've seen some attempts to send files in the trac source itself and other plugins, but since I'm new to web programming that doesn't really help. </p>
  
  <p><strong>Update1</strong>
  I've been trying to solve the problem the way Felix suggested, which opened up a new problem for me. 
  This (stupid) example should demonstrate my problem. 
  My Macro generates the following URL and adds it as a link to the wikipage. </p>
  
  <pre><code>//http://servername.com/projectname/wiki/page_name?teddy=bear    
  </code></pre>
  
  <p>But the RequestHandler doesn't react, even if the condition returns true. 
  <strong>Edit:</strong> This piece of code now shows the working version for the example. </p>
  
  <p>New URL:</p>
  
  <pre><code>#example url
  #http://127.0.0.1:8000/prove/files/new
  
  class CustomRequestHandlerModule(Component):
      implements(IRequestHandler)
  
      def match_request(self,req):
          #old, not working
          #return "teddy=bear"== str(req.path_info).split('?')[1]
          #new
          accept="/files/new"== str(req.path_info)
          return accept
  
      def process_request(self,req):
          csvfile = self.create_csv()
          req.send_response(200)
          req.send_header('Content-Type', 'text/csv')
          req.send_header('Content-length', len(csvfile))
          req.send_header('Content-Disposition','filename=lala.csv')
          req.end_headers()
          req.write(csvfile)
          raise RequestDone     
  </code></pre>
  
  <p><strong>Update2</strong>
  Inserting loggingstatements shows match_request never gets called. </p>
  
  <p>What am I doing wrong? (Yes, the create_csv() exists already)</p>
  
  <p><strong>Update 3</strong> Thx, for helping =)</p>