"Content-Length too" long when downloading a file using Tornado

Using a slightly modified version of this Tornado download application on my development machine, I get the following error from the tornado server and a blank page every time I try to upload large files (+ 100 MB):

[I 130929 07:45:44 httpserver: 330] Formatted HTTP request from 127.0.0.1: content length too long

No problem downloading files up to ~ 20 MB.

so I am wondering if there is any specific file upload limit on the Tornado web server? Or it has something to do with the available device memory. And for whatever reason, how can I overcome this problem?

+6
source share
1 answer

Tornado has a custom limit for download size (10 MB by default). You can increase the limit by passing max_buffer_size to the HTTPServer (or Application.listen ) constructor. However, since Tornado (version 3.1) reads the entire boot body into a single continuous line in memory, it is dangerous to limit the limit too much. One popular alternative is the nginx download module .

+11
source

Source: https://habr.com/ru/post/954867/


All Articles