DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Upload File With Http Client (multipart/form-data)
def post_multipart(host, selector, fields, files): """ Post fields and files to an http host as multipart/form-data. fields is a sequence of (name, value) elements for regular form fields. files is a sequence of (name, filename, value) elements for data to be uploaded as files Return the server's response page. """
See the rest of the implementation <a href=http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/146306>here</a>