GithubHelp home page GithubHelp logo

multipart's Introduction

Parser for multipart/form-data

This module provides a parser for the multipart/form-data format. It can read from a file, a socket or a WSGI environment. The parser can be used to replace cgi.FieldStorage (without the bugs) and works with Python 2.5+ and 3.x (2to3).

Features

  • Parses multipart/form-data and application/x-www-form-urlencoded.
  • Produces useful error messages in 'strict'-mode.
  • Gracefully handle uploads of unknown size (missing Content-Length header).
  • Fast memory mapped files (io.BytesIO) for small uploads.
  • Temporary files on disk for big uploads.
  • Memory and disk resource limits to prevent DOS attacks.
  • Fixes many shortcomings and bugs of cgi.FieldStorage.
  • 100% test coverage.

Limitations

  • Only parses multipart/form-data as seen from actual browsers.
    • Not suitable as a general purpose multipart parser (e.g. for multipart emails).
    • No multipart/mixed support (RFC 2388, deprecated in RFC 7578)
    • No encoded-word encoding (RFC 2047).
    • No base64 or quoted-printable transfer encoding.
  • Part headers are expected to be encoded in the charset given to the Multipart/MultipartParser constructor. [For operability considerations, see RFC 7578, section 5.1.]
  • The size of headers are not counted against the in-memory limit (todo).

Changelog

  • 0.2 (in development) * Dropped support for Python versions below 3.6. Stay on 0.1 if you need Python 2.5+ support.
  • 0.1 (21.06.2010) * First release

multipart's People

Contributors

defnull avatar wobsta avatar theelous3 avatar onealj avatar luchr avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.