Skip to main content

A handler for urllib2 to enable multipart form uploading

Project description

Usage:
Enables the use of multipart/form-data for posting forms
add a fix for utf-8 systems.

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.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

MultipartPostHandler2-0.1.2-py2.7.egg (5.5 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for MultipartPostHandler2-0.1.2.tar.gz
Algorithm Hash digest
SHA256 dc6277e5169effac1f5bbbf48e3dcaf34f7a3b4aa860d18d2bc1de735a4981c6
MD5 92381e16168f003a85cec8bb4bcc3036
BLAKE2b-256 4d58266e01b4028c3bede690ce12f7c48f90c31264cefc9269e31c1f403c138e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for MultipartPostHandler2-0.1.2-py2.7.egg
Algorithm Hash digest
SHA256 b1358812e6a988014182197e27c11ce55e1826d0804bfb1dff19222a8fdf6b9f
MD5 bac1d33d296dbddbd9e257d3ebaac134
BLAKE2b-256 974027dfcc8201e50f5b0ce4879b4b6a87cf35691d4153903fa6e3dc754d5b01

See more details on using hashes here.

Supported by

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