Skip to content

Commit 83ebad1

Browse files
Fix regression in upload_resource function
Fixes #293
1 parent 7c8aeb2 commit 83ebad1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cloudinary/uploader.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ def upload_image(file, **options):
6262

6363

6464
def upload_resource(file, **options):
65-
result = upload_large(file, **options)
65+
upload_func = upload
66+
if hasattr(file, 'size') and file.size > UPLOAD_LARGE_CHUNK_SIZE:
67+
upload_func = upload_large
68+
69+
result = upload_func(file, **options)
70+
6671
return cloudinary.CloudinaryResource(
6772
result["public_id"], version=str(result["version"]),
6873
format=result.get("format"), type=result["type"],

0 commit comments

Comments
 (0)