There was a missing closing tag in the template inside the upload <form> tag like <form ... enctype="mutipart/form-data" , hence get_uploads('file_upload') was put in a bad situation to work as expected. After closing the tag, it is working.
On Wednesday, January 8, 2020 at 8:20:10 PM UTC+5:30, Sunando Samaddar wrote: > > I hope this is the right place for this question. Can somebody please help > me with this basic Blobstore file upload issue? > > snapshot from *main.py* > ``` > class HomeHandler(BaseHandler): > def get(self): > upload_url = blobstore.create_upload_url('/upload_file', > gs_bucket_name=BUCKET_NAME) > context['upload_url'] = upload_url > self.render_response('home.html', **context) > > > class UploadHandler(BlobstoreUploadHandler): > def post(self): > """Upload JSON and CSV files to CS bucket.""" > file_infos = self.get_file_infos('file_upload') # returns [] everytime > uploads = self.get_uploads('file_upload') # returns [] everytime > print(file_infos, uploads) > > self.redirect('/'.join(['/?', urllib.urlencode({'file_upload': uploads[0] > or uploads[1]})])) > > > app = webapp2.WSGIApplication([('/', HomeHandler), > ('/upload_file', UploadHandler)], debug=True) > ``` > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-appengine+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/de977e1a-0921-4e52-ba06-c1b0954e3ddc%40googlegroups.com.