Skip to content
Myr

docs: Change max content length value to megabyte

Before adoption: this commit came in with the history the project adopted, so no landing records it.

16 * 1024 * 1024 = 16 MiB (Mebibyte) 16 * 1000 * 1000 = 16 MB (Megabyte) The example is in megabytes, not in mebibytes.

authored by Eido95 · committed by GitHub · parent 353d891 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:docs/patterns/fileuploads.rst+1 added-1 removed
145 unmodified lines
146147 from flask import Flask, Request148149 app = Flask(__name__)150 app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024150 app.config['MAX_CONTENT_LENGTH'] = 16 * 1000 * 1000151152The code above will limit the maximum allowed payload to 16 megabytes.153If a larger file is transmitted, Flask will raise a154:exc:`~werkzeug.exceptions.RequestEntityTooLarge` exception.
36 unmodified lines