title: how to upload muti file using html5 on google app engine(python)
body: <p>this is my code, the upload.py:</p>
  
  <pre><code>class MyModel(db.Model):
      data = db.BlobProperty(required=True)
      mimetype = db.StringProperty(required=True)
  
  class BaseRequestHandler(webapp.RequestHandler):
    def render_template(self, filename, template_args=None):
      if not template_args:
        template_args = {}
      path = os.path.join(os.path.dirname(__file__), 'templates', filename)
      self.response.out.write(template.render(path, template_args))
  
  class upload(BaseRequestHandler):
    def get(self):
      self.render_template('index.html',)
    def post(self):
      file = self.request.POST['file']
      obj = MyModel(data=file.value, mimetype=file.type)
      obj.put()
      o=file
      #self.response.out.write(''.join('%s: %s &lt;br/&gt;' % (a, getattr(o, a)) for a in dir(o)))
      #return
      file_url = "http://%s/download/%d/%s" % (self.request.host, obj.key().id(), file.filename)
      self.response.out.write("Your uploaded file is now available at &lt;a href='%s'&gt;%s&lt;/a&gt;" % (file_url,file_url,))
  </code></pre>
  
  <p>and the index.html is :</p>
  
  <pre><code>&lt;form enctype="multipart/form-data" action="/" method="post"&gt;
    &lt;input type="file" name="file" multiple="true" /&gt;
    &lt;input type="submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>you can use <code>file = self.request.POST['file']</code> to get one file , but using html5 muti file ,</p>
  
  <p>how to get muti file using python when post  ?</p>
  
  <p>thanks</p>
  
  <p><strong>upload</strong></p>
  
  <p>it is ok now , Follow this article: <a href="https://stackoverflow.com/questions/1503526/receive-multi-file-post-with-google-app-engine">Receive multi file post with google app engine</a></p>
  
  <pre><code>class Download_file(db.Model):
      data = db.BlobProperty(required=True)
      mimetype = db.StringProperty(required=True)
      download_url = db.StringProperty()
  
  class BaseRequestHandler(webapp.RequestHandler):
    def render_template(self, filename, template_args=None):
      if not template_args:
        template_args = {}
      path = os.path.join(os.path.dirname(__file__), 'templates', filename)
      self.response.out.write(template.render(path, template_args))
  
  class upload(BaseRequestHandler):
      def get(self):
          files=Download_file.all()
          self.render_template('index.html',{'files':files})
      def post(self):
          files = self.request.POST.multi.__dict__['_items']
          #self.response.out.write(files)
          for file in files:
              file=file[1]
              obj = Download_file(data=file.value, mimetype=file.type)
              obj.put()
              file_url = "http://%s/download/%d/%s" % (self.request.host, obj.key().id(), file.filename)
              file_url = "&lt;a href='%s'&gt;%s&lt;/a&gt;" % (file_url,file_url,)
              obj.download_url=file_url
              obj.put()
              self.response.out.write("Your uploaded file is now available at %s &lt;/br&gt;" % (file_url))
  
  class download(BaseRequestHandler):
      def get(self,id,filename):
          #id=self.request.get('id')
          entity = Download_file.get_by_id(int(id))
          self.response.headers['Content-Type'] = entity.mimetype
          self.response.out.write(entity.data)
  </code></pre>