대용량 파일 업로드
- 업로드 세션 만들기
- 바이 driveItem 이용한 고유 식별자drive/items/{item-id}
- 파일 시스템 경로 별 /drive/root:/path/to/file
- 업로드 세션에 바이트 업로드

- 다운로드 링크 생성


- Outlook에 보여주기

prependAsync(data, options, callback)
Adds the specified content to the beginning of the item body.
The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content.
When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (see the Examples section for a sample).
TypeScriptCopy
prependAsync(data: string, options?: Office.AsyncContextOptions & CoercionTypeOptions, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
data
string
The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters.
options
Office.AsyncContextOptions & CoercionTypeOptions
Optional. An object literal that contains one or more of the following properties. asyncContext: Developers can provide any object they wish to access in the callback method. coercionType: The desired format for the body. The string in the data parameter will be converted to this format.
callback
(asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. Any errors encountered will be provided in the asyncResult.error property.
Returns
void
Remarks
Minimum permission level: ReadWriteItem
Applicable Outlook mode: Compose
Errors:
- DataExceedsMaximumSize: The data parameter is longer than 1,000,000 characters.
Examples
JavaScriptCopy
// When including links in HTML markup, you can disable online link preview
// by setting the id attribute on the anchor (<a>) to "LPNoLP".
Office.context.mailbox.item.body.prependAsync(
'Click here!',
{coercionType: Office.CoercionType.Html},
callback);
prependAsync(data, callback)
Adds the specified content to the beginning of the item body.
The prependAsync method inserts the specified string at the beginning of the item body. After insertion, the cursor is returned to its original place, relative to the inserted content.
When including links in HTML markup, you can disable online link preview by setting the id attribute on the anchor (<a>) to "LPNoLP" (see the Examples section for a sample).
TypeScriptCopy
prependAsync(data: string, callback?: (asyncResult: Office.AsyncResult<void>) => void): void;
Parameters
data
string
The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters.
callback
(asyncResult: Office.AsyncResult<void>) => void
Optional. When the method completes, the function passed in the callback parameter is called with a single parameter of type Office.AsyncResult. Any errors encountered will be provided in the asyncResult.error property.
Returns
void
Remarks
Minimum permission level: ReadWriteItem
Applicable Outlook mode: Compose
Errors:
- DataExceedsMaximumSize: The data parameter is longer than 1,000,000 characters.
출처: <https://docs.microsoft.com/en-us/javascript/api/outlook/office.body?view=outlook-js-preview>
- OneDrive에 업로드 한 파일 삭제
- 폴더 안에 파일 조회
Outlook Add-In
- 로그인

참고자료
https://github.com/adambu/createuploadsession-graph-jquery/blob/master/App/Scripts/App.js
대용량 파일 업로드
- 폴더 생성
- 업로드 세션 만들기
- 업로드 세션에 바이트 업로드
{
- "@odata.context":"https://headit2-my.sharepoint.com/personal/slkim_headit_co_kr/_api/v2.0/$metadata#items/$entity",
- "@odata.type":"#oneDrive.item",
- "@odata.id":"https://headit2-my.sharepoint.com/personal/slkim_headit_co_kr/_api/v2.0/drive/items/017TQMZMJOMWJPHFLRQRDL26VXQJARXS3J",
- "@odata.editLink":"drive/items/017TQMZMJOMWJPHFLRQRDL26VXQJARXS3J",
- "@content.downloadUrl":"https://headit2-my.sharepoint.com/personal/slkim_headit_co_kr/_layouts/15/download.aspx?UniqueId=f392652e-7195-4684-bd7a-b782411bcb69&Translate=false&tempauth=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvaGVhZGl0Mi1teS5zaGFyZXBvaW50LmNvbUBjM2NmMGQzZi0xN2M0LTQyYTQtOTg5Ny00OGYyNDM1MzEyYzQiLCJpc3MiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAiLCJuYmYiOiIxNTg5OTYyMzEyIiwiZXhwIjoiMTU4OTk2NTkxMiIsImVuZHBvaW50dXJsIjoiNjIyeVJ3UG5IZ1VrMnd1WjBYeEVCdngxNVBjN05HcE9zdEFMSGxYNXFMST0iLCJlbmRwb2ludHVybExlbmd0aCI6IjE0OSIsImlzbG9vcGJhY2siOiJUcnVlIiwiY2lkIjoiTURVek5UVTBPV1l0T1RCbVpDMWlNREF3TFRNeFptRXRPVEkwTURGak5HRmpZelV3IiwidmVyIjoiaGFzaGVkcHJvb2Z0b2tlbiIsInNpdGVpZCI6Ik1XTm1aRFl6T1RZdE1qQmhZUzAwTW1aakxUaGhORFl0WTJVeVpUZGlNemcxTVdNNSIsImFwcF9kaXNwbGF5bmFtZSI6Ik9mZmljZTM2NUNsb3VkVHlwZURlbW9BZG1pbkFwcCIsIm5hbWVpZCI6IjgwZWEwOGE0LWIzOWItNDA2YS1iMjg3LTRiNDc5ZDJiNTk5YUBjM2NmMGQzZi0xN2M0LTQyYTQtOTg5Ny00OGYyNDM1MzEyYzQiLCJyb2xlcyI6ImFsbHNpdGVzLndyaXRlIGdyb3VwLndyaXRlIGFsbGZpbGVzLndyaXRlIGFsbHByb2ZpbGVzLndyaXRlIGFsbHByb2ZpbGVzLnJlYWQiLCJ0dCI6IjEiLCJ1c2VQZXJzaXN0ZW50Q29va2llIjpudWxsfQ.QkZ6TllSTzNkYUZmemZaWGVMeGp1eVkxUUZZUzJYeWRvb2JUODlnTDA0az0&ApiVersion=2.0",
- "createdBy":{
- "application":{
- "id":"80ea08a4-b39b-406a-b287-4b479d2b599a",
- "displayName":"Office365CloudTypeDemoAdminApp"
}
}, - "createdDateTime":"2020-05-20T08:10:42Z",
- "eTag":"\"{F392652E-7195-4684-BD7A-B782411BCB69},3\"",
- "id":"017TQMZMJOMWJPHFLRQRDL26VXQJARXS3J",
- "lastModifiedBy":{
- "application":{
- "id":"80ea08a4-b39b-406a-b287-4b479d2b599a",
- "displayName":"Office365CloudTypeDemoAdminApp"
}
}, - "lastModifiedDateTime":"2020-05-20T08:11:52Z",
- "name":"HeadMailFiles 2",
- "parentReference":{
- "driveId":"b!lmP9HKog_EKKRs4uezhRydnPojMfAcFAh1E4DWUibIToi-0muzm1Q6cFu6MLhevz",
- "driveType":"business",
- "id":"017TQMZMN6Y2GOVW7725BZO354PWSELRRZ",
- "path":"/drive/root:"
}, - "webUrl":"https://headit2-my.sharepoint.com/personal/slkim_headit_co_kr/Documents/HeadMailFiles%202",
- "cTag":"\"c:{F392652E-7195-4684-BD7A-B782411BCB69},2\"",
- "file":{
- "hashes":{
- "quickXorHash":"JPOSaqVXyJYVUxcBQdH7g0LEh2w="
}, - "irmEnabled":false,
- "mimeType":""
}, - "fileSystemInfo":{
- "createdDateTime":"2020-05-20T08:10:42Z",
- "lastModifiedDateTime":"2020-05-20T08:11:52Z"
}, - "size":7862
}
'Cloud > Microsoft 365' 카테고리의 다른 글
[OneDrive] 원드라이브 다운로드 및 설치하는 방법 (1) - Mac에서 OneDrive 다운로드 하는 방법 (0) | 2023.04.01 |
---|---|
Office 365 Add-In (0) | 2022.04.01 |
Onedrvie 파일 업로드 API (0) | 2022.04.01 |
Outlook 조직도 개발 기초 (0) | 2022.04.01 |
OneDrive API (0) | 2022.04.01 |