diff --git a/shotgun_api3/shotgun.py b/shotgun_api3/shotgun.py index f11f895d..47268733 100644 --- a/shotgun_api3/shotgun.py +++ b/shotgun_api3/shotgun.py @@ -2426,7 +2426,12 @@ def _upload_to_storage(self, entity_type, entity_id, path, field_name, display_n is_multipart_upload = (os.path.getsize(path) > self._MULTIPART_UPLOAD_CHUNK_SIZE) - upload_info = self._get_attachment_upload_info(is_thumbnail, filename, is_multipart_upload) + # Step 1b: quote filename + # To avoid the filename turning into garbled text, + # quote filename using urllib.parse.quote("") + filename = filename.encode("utf8") + quote_filename = urllib.parse.quote(filename) + upload_info = self._get_attachment_upload_info(is_thumbnail, quote_filename, is_multipart_upload) # Step 2: upload the file # We upload large files in multiple parts because it is more robust