Home / Function/ max_form_memory_size() — flask Function Reference

max_form_memory_size() — flask Function Reference

Architecture documentation for the max_form_memory_size() function in wrappers.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  59135935_6f4b_45a5_e08c_06364198ef45["max_form_memory_size()"]
  eae007fa_ef39_ed97_113d_df4ad5001c0e["Request"]
  59135935_6f4b_45a5_e08c_06364198ef45 -->|defined in| eae007fa_ef39_ed97_113d_df4ad5001c0e
  style 59135935_6f4b_45a5_e08c_06364198ef45 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/wrappers.py lines 93–113

    def max_form_memory_size(self) -> int | None:
        """The maximum size in bytes any non-file form field may be in a
        ``multipart/form-data`` body. If this limit is exceeded, a 413
        :exc:`~werkzeug.exceptions.RequestEntityTooLarge` error is raised. If it
        is set to ``None``, no limit is enforced at the Flask application level.

        Each request defaults to the :data:`MAX_FORM_MEMORY_SIZE` config, which
        defaults to ``500_000``. It can be set on a specific ``request`` to
        apply the limit to that specific view. This should be set appropriately
        based on an application's or view's specific needs.

        .. versionchanged:: 3.1
            This is configurable through Flask config.
        """
        if self._max_form_memory_size is not None:
            return self._max_form_memory_size

        if not current_app:
            return super().max_form_memory_size

        return current_app.config["MAX_FORM_MEMORY_SIZE"]  # type: ignore[no-any-return]

Subdomains

Frequently Asked Questions

What does max_form_memory_size() do?
max_form_memory_size() is a function in the flask codebase, defined in src/flask/wrappers.py.
Where is max_form_memory_size() defined?
max_form_memory_size() is defined in src/flask/wrappers.py at line 93.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free