'Return the filename associated with the payload if present.
The filename is extracted from the Content-Disposition header\'s
`filename\' parameter, and it is unquoted.  If that header is missing
the `filename\' parameter, this method falls back to looking for the
`name\' parameter.'

def get_filename(self, failobj=None):

    missing = object()
    filename = self.get_param('filename', missing, 'content-disposition')
    if (filename is missing):
        filename = self.get_param('name', missing, 'content-type')
    if (filename is missing):
        return failobj
    return utils.collapse_rfc2231_value(filename).strip()
