title: How to get an upload progress bar for urllib2?
body: <p>I currently use the following code to <strong>upload</strong> one file to a remote server:</p>
  
  <pre><code>import MultipartPostHandler, urllib2, sys
  cookies = cookielib.CookieJar()
  opener = urllib2.build_opener(MultipartPostHandler.MultipartPostHandler)
  params = {"data" : open("foo.bar") }
  request=opener.open("http://127.0.0.1/api.php", params)
  response = request.read()
  </code></pre>
  
  <p>This works fine, but for larger files the upload takes some time, and it would be nice to have a callback that allows me to display the upload progress?</p>
  
  <p>I already tried the kodakloader solution, but it does not has a callback for a single file.</p>
  
  <p>Does anyone knows a solution?</p>