diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2020-01-11 15:14:16 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2020-01-11 15:14:16 +0100 |
| commit | e091e3fb66b0fe6310dbc681d16401a506e8600e (patch) | |
| tree | 5eb9b7cc0263b34bcc8c85fc60c933909177f991 | |
| parent | fd54efeb90fe23e7fd2694f0785ce7784103676b (diff) | |
mime name
| -rw-r--r-- | cli/app/utils/cortex_utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cli/app/utils/cortex_utils.py b/cli/app/utils/cortex_utils.py index 0a26330..1a52a59 100644 --- a/cli/app/utils/cortex_utils.py +++ b/cli/app/utils/cortex_utils.py @@ -99,6 +99,9 @@ def upload_file_to_cortex(opt_folder_id, fn, **kwargs): """Upload a file from disk""" base_fn = os.path.basename(fn) mimetype_tup = mimetypes.guess_type(base_fn) - mimetype = "{}/{}".format(mimetype_tup[0], mimetype_tup[1]) + mime_name = mimetype_tup[1] + if '/' in mime_name: + mime_name = mime_name.split('/')[0] + mimetype = "{}/{}".format(mimetype_tup[0], mime_name) with open(fn, 'rb') as fp: return upload_fp_to_cortex(opt_folder_id, (base_fn, fp, mimetype,), **kwargs) |
