when I am trying to attach a pdf file to the confluence page from local and also /tmp/name.pdf folder through api. It is throwing 500 error for tmp folder and FileNotFoundError: [Errno 2] No such file or directory from local .the lambda code below which I tried
def lambda_handler(event, context):
url = 'https://your-domain.atlassian.net/wiki/rest/api/content/pageid/child/attachment'
headers = {'Accept': '*/*', 'Authorization': 'Basic auth','Content-Type': 'multipart/form-data', 'X-Atlassian-Token': 'nocheck'}
data = {"comment": "This is War-Report"}
files={'file': open(r'C:\Users\***\Downloads\name.pdf', 'rb')}
#files={'file': open('/tmp/name.pdf', 'rb')} ###(saved the pdf file from s3 to /tmp folder)
response = requests.post(url, headers=headers, verify=False, data=data, files = files)
print(response)