본문 바로가기

Cloud/Microsoft 365

One Drive 대용량 파일 업로드

728x90
반응형
SMALL

대용량 파일 업로드

  1. 업로드 세션 만들기

 

  • 바이 driveItem 이용한 고유 식별자drive/items/{item-id}
  • 파일 시스템 경로 별 /drive/root:/path/to/file

 

  1. 업로드 세션에 바이트 업로드
  1. 다운로드 링크 생성

 

  1. 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).

API set: Mailbox 1.1 ]

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 levelReadWriteItem

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).

API set: Mailbox 1.1 ]

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 levelReadWriteItem

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>

 

 

 

  1. OneDrive 업로드 파일 삭제

 

  • 폴더 안에 파일 조회
  •  

Outlook Add-In

  1. 로그인

 

 

참고자료

https://github.com/adambu/createuploadsession-graph-jquery/blob/master/App/Scripts/App.js

https://medium.com/@cesarcodes/uploading-large-files-to-onedrive-with-microsoft-graph-api-33aeaa7a3319

https://developer.microsoft.com/en-us/graph/blogs/30daysmsgraph-day-29-use-case-upload-files-to-onedrive/

 

대용량 파일 업로드

 

  • 폴더 생성

 

 

  • 업로드 세션 만들기

 

  • 업로드 세션에 바이트 업로드

{

}

728x90
반응형
LIST