Skip to content

Commit

Permalink
Bszabo/tnl 11327 file upload (#257)
Browse files Browse the repository at this point in the history
* feat: bszabo/TNL-11327-multipart MIME

Set multipart/form-data MIME type to be binary to support file uploads through the API Gateway

* feat: TNL-11327 fix syntax for media type config
  • Loading branch information
bszabo committed Dec 20, 2023
1 parent 93dd1e9 commit 551a418
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/aws/common/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ def deploy_api(client, rest_api_id, swagger_filename, stage_name, stage_variable

swagger = open(swagger_filename, 'r', encoding="utf-8") # pylint: disable=consider-using-with

api_response = client.put_rest_api(restApiId=rest_api_id, mode='overwrite', body=swagger.read())
api_response = client.put_rest_api(
restApiId=rest_api_id,
mode='overwrite',
body=swagger.read(),
parameters={'binaryMediaTypes': 'multipart/form-data'}, # This MIME needs to be binary for file uploads
)
logging.info('Existing API ID "%s" updated (name "%s")', api_response['id'], api_response['name'])

deployment_response = client.create_deployment(
Expand Down

0 comments on commit 551a418

Please sign in to comment.