From 1928fe3639995dc6e386bb20cb93f9a0a720d88a Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Sun, 9 Jun 2013 11:54:43 -0400 Subject: [PATCH] Added optional parameter form_field to _pack_image --- tweepy/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tweepy/api.py b/tweepy/api.py index 31ccc8d..f1308a8 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -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()) -- 2.25.1