Commit 1928fe36 authored by Aaron Hill's avatar Aaron Hill
Browse files

Added optional parameter form_field to _pack_image

parent d50ce7d7
......@@ -690,7 +690,7 @@ class API(object):
""" Internal use only """
@staticmethod
def _pack_image(filename, max_size):
def _pack_image(filename, max_size, form_field="image"):
"""Pack image from file into multipart-formdata post body"""
# image must be less than 700kb in size
try:
......@@ -712,7 +712,7 @@ class API(object):
BOUNDARY = 'Tw3ePy'
body = []
body.append('--' + BOUNDARY)
body.append('Content-Disposition: form-data; name="image"; filename="%s"' % filename)
body.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (form_field, filename))
body.append('Content-Type: %s' % file_type)
body.append('')
body.append(fp.read())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment