Skip to main content

A handler for urllib2 to enable multipart form uploading

Project description

This is MultipartPostHandler plus a fix for utf-8 systems.

Usage:
Enables the use of multipart/form-data for posting forms

Inspirations:
Upload files in python:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306

urllib2_file:
Fabien Seisen: <fabien@seisen.org>

Example:
import MultipartPostHandler, urllib2, cookielib

cookies = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies),
MultipartPostHandler.MultipartPostHandler)
params = { "username" : "bob", "password" : "riviera",
"file" : open("filename", "rb") }
opener.open("http://wwww.bobsite.com/upload/", params)

Further Example:
The main function of this file is a sample which downloads a page and
then uploads it to the W3C validator.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MultipartPostHandler2-0.1.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

MultipartPostHandler2-0.1.1-py2.7.egg (6.6 kB view details)

Uploaded Egg

File details

Details for the file MultipartPostHandler2-0.1.1.tar.gz.

File metadata

File hashes

Hashes for MultipartPostHandler2-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9e17276808f0b8332f53142816e6795f55634cdf460a881b35753f31bc9dc288
MD5 e9c4b842ca5741dff9e6ea6cd5f2908e
BLAKE2b-256 c5eba1725c023b209d239a4f09c944b56df0b2ca6eb829afb9583e2d8a4df55b

See more details on using hashes here.

File details

Details for the file MultipartPostHandler2-0.1.1-py2.7.egg.

File metadata

File hashes

Hashes for MultipartPostHandler2-0.1.1-py2.7.egg
Algorithm Hash digest
SHA256 2f78848e2f71f2edd6a500c6cf47a1d615e8ef72dda62af7298504af1e74279c
MD5 b38d4404dfc6a51ae5e4205c53b82c07
BLAKE2b-256 abb422a9e5af764c3f5fd26e2e95070788dc2dae7713658700eaf43edafa12c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page