Skip to content
Advertisement

How to get form POST input in Tornado?

I amd new to Tornado framework and trying to make a simple form to upload images:

JavaScript

I can successfully receive the Posted file using:

JavaScript

However I’m unable to receive the alt input. I tried alt = self.request.alt but I get this error

JavaScript

and when I use alt = self.request.files['alt'], I get:

JavaScript

I ran out of ideas so appreciate your help.

UPDATE:

I found that this works:

JavaScript

But still open for better solutions.

Advertisement

Answer

Try code below

JavaScript
Advertisement