Skip to content Skip to sidebar Skip to footer

Printing Files In Google App Engine

I am trying to read and print a file in Google App Engine, but the code bellow seems unresponsive. I can upload the file, and my expectation was that it would just print the text,

Solution 1:

Your form is sent using the HTTP GET method, but for file uploads you need POST. Change it from:

method='get'

to:

method='post'

You will also need to handle POST requests in a different method. The POST body itself should be available as self.request.POST. So you end up with something like:

defpost(self):
    file = self.request.POST['file']
    self.response.out.write(file)

Post a Comment for "Printing Files In Google App Engine"