

def add_file(self, fieldname, pathname, mimetype=None, filename=None):
    'Add a file section.\n\n        The file will be uploaded. You must use the full path name.\n\n        Args:\n            fieldname:  name of the form field.\n             pahtname:  Full path to the file.\n             mimetype:  Override the auto-detected mime type.\n             filename:  Override the base name of the given pathname.\n        '
    plist = [pycurl.FORM_FILE, mimetype]
    if mimetype:
        plist.append(pycurl.FORM_CONTENTTYPE)
        plist.append(mimetype)
    if filename:
        plist.append(pycurl.FORM_FILENAME)
        plist.append(filename)
    if (fieldname in self):
        dict.__setitem__(self, fieldname, (self[fieldname] + tuple(plist)))
    else:
        dict.__setitem__(self, fieldname, tuple(plist))

dataset/ETHPy150Open kdart/pycopia/WWW/pycopia/WWW/client.py HTTPForm.add_file/VarMisuse@31/153 `pathname`->`mimetype`