Skip to content

Commit

Permalink
Updating PR
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyg-cld committed Nov 5, 2024
1 parent 08e727f commit 0d2f1c4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cloudinary_cli/utils/api_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from cloudinary_cli.utils.json_utils import print_json, write_json_to_file
from cloudinary_cli.utils.utils import log_exception, confirm_action, get_command_params, merge_responses, \
normalize_list_params, ConfigurationError, print_api_help, duplicate_values
import re

PAGINATION_MAX_RESULTS = 500

Expand Down Expand Up @@ -116,10 +117,11 @@ def upload_file(file_path, options, uploaded=None, failed=None):
verbose = logger.getEffectiveLevel() < logging.INFO

try:
size = path.getsize(file_path)
upload_func = uploader.upload
if size > 20000000:
upload_func = uploader.upload_large
if not re.match(r'^https?://', file_path):
size = path.getsize(file_path)
if size > 20000000:
upload_func = uploader.upload_large
result = upload_func(file_path, **options)
disp_path = _display_path(result)
disp_str = f"as {result['public_id']}" if not disp_path \
Expand Down

0 comments on commit 0d2f1c4

Please sign in to comment.