Force any methods that handle image uploading to open the image (for encoding) as a Binary file, was doing ASCII before (oddly, this wasn't caught until now. Major thanks to Yoav Aviram for pointing this out. :D
This commit is contained in:
parent
34340248de
commit
d6f6df2045
2 changed files with 4 additions and 4 deletions
|
|
@ -1257,7 +1257,7 @@ class setup:
|
|||
"""
|
||||
if self.authenticated is True:
|
||||
try:
|
||||
files = [("image", filename, open(filename).read())]
|
||||
files = [("image", filename, open(filename, 'rb').read())]
|
||||
fields = []
|
||||
content_type, body = self.encode_multipart_formdata(fields, files)
|
||||
headers = {'Content-Type': content_type, 'Content-Length': str(len(body))}
|
||||
|
|
@ -1278,7 +1278,7 @@ class setup:
|
|||
"""
|
||||
if self.authenticated is True:
|
||||
try:
|
||||
files = [("image", filename, open(filename).read())]
|
||||
files = [("image", filename, open(filename, 'rb').read())]
|
||||
fields = []
|
||||
content_type, body = self.encode_multipart_formdata(fields, files)
|
||||
headers = {'Content-Type': content_type, 'Content-Length': str(len(body))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue