Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion shotgun_api3/shotgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_encoding_utf8>")
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
Expand Down