์๋ ํ์ธ์ @vgrem @Toilal ,
๊ทํ์ ์ฝ๋๋ฅผ ์ฐพ๊ณ "์์ฒญ ID"๋ฌธ์์ด๊ณผ ์ฒจ๋ถ ํ์ผ์ ์ถ๊ฐํ๋ SharePoint ๋ชฉ๋ก์ ์ ์ค์ ๋ง๋๋ ์ฝ๋๋ฅผ ์ฐพ์ผ๋ ค๊ณ ํ์ต๋๋ค.
์ด๊ฒ์ด ๋ด๊ฐํด์ผ ํ ์ผ์
๋๋ค.
๋นจ๊ฐ์ ํ์ดํ๊ฐ ๋ณด์ฌ ์ฃผ๋ฏ์ด "REQUEST_ID"๋ฌธ์์ด์ ์ถ๊ฐํ๊ณ "Attachments"ํ์ผ์ ์ถ๊ฐํด์ผํฉ๋๋ค.
ํ์ผ์ ์ ๋ก๋ํ๋ ์ฝ๋๋ฅผ ๋ณด์์ง๋ง ์ฒจ๋ถ ํ์ผ๊ณผ ๊ด๋ จ๋ ๊ฒ์ ์ฐพ์ง ๋ชปํ์ต๋๋ค.
์ด๋ค ๋์์ด๋ผ๋ ํ์ํฉ๋๋ค!
TKS
์ธ์ฌ @ libora6 ,
๋ค์์ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ฃผ๋ ์ผ๋ฐ์ ์ธ ์์ ๋๋ค.
ctx = ClientContext(site_url).with_credentials(ClientCredential(client_id, client_secret))
list_object = ctx.web.lists.get_by_title(list_title)
# 1. create a list item first
new_item = list_object.add_item({
"Title": "Task 123"
}).execute_query()
# 2. upload attachment into list item
with open(attachment_path, 'rb') as content_file:
file_content = content_file.read()
attachment_file_name = os.path.basename(attachment_path)
attachment_file_information = AttachmentfileCreationInformation(attachment_file_name, file_content)
attachment_file = new_item.attachmentFiles.add(attachment_file_information).execute_query()
๋ฉ๋ชจ:
Title
๋ง ์ง์ ๋์ด ์์ต๋๋ค. ๊ทํ์ ๊ฒฝ์ฐ์๋ REQUEST_ID
ํ๋์ ์ ์ ํ ์ด๋ฆ์ ์ง์ ํด์ผํฉ๋๋ค.๊ฒฐ๊ณผ
์ ์ํ ์ง์์ ์ํด @vgrem tks.