Skip to content
This repository was archived by the owner on Nov 23, 2024. It is now read-only.

Commit a73ce2b

Browse files
Merge pull request #128 from alitaker/master
Prevent Error 5: Filetype was not recognised specifying the file exte…
2 parents 6e37a22 + d13df18 commit a73ce2b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

flickrapi/auth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ def do_upload(self, filename, url, params=None, fileobj=None, timeout=None):
285285

286286
if not fileobj:
287287
fileobj = open(filename, 'rb')
288-
params['photo'] = ('dummy name', fileobj)
288+
unused_filename, file_extension = os.path.splitext(filename)
289+
params['photo'] = ('dummy_name' + file_extension, fileobj)
289290
m = MultipartEncoder(fields=params)
290291
auth = {'Authorization': headers.get('Authorization'),
291292
'Content-Type': m.content_type}

0 commit comments

Comments
 (0)