Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
src/
scripts/
scripts/
design/
changelogs/
16 changes: 7 additions & 9 deletions docs/tasks/LargeFileUploadTask.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,18 @@ const fileObject = new FileUpload(readStream, fileName, totalsize);
**Initiate the LargefileUploadTask options with Progress Handler and Range Size**

```typescript
const progress = (range?: Range, extraCallBackParams?: unknown) => {
const progress = (range?: Range, extraCallBackParam?: unknown) => {
// Handle progress event
};

const progressCallBack: Progress = {
const uploadEventHandlers: UploadEventHandlers = {
progress,
extraCallBackParam, // additional parameters to the callback
};

const options: LargeFileUploadTaskOptions = {
rangeSize: 327680,
progressCallBack: progressCallBack,
uploadEventHandlers: UploadEventHandlers,
};
```

Expand All @@ -128,18 +128,16 @@ _You can also use `OneDriveLargeFileUploadTask` which provides easier access to
Example -

```typescript
const progressCallBack: Progress = {
const uploadEventHandlers: UploadEventHandlers = {
progress,
completed,
failure,
extraCallBackParams: true,
extraCallBackParam: true,
};

const options: OneDriveLargeFileUploadOptions = {
path: "/Documents",
fileName,
rangeSize: 1024 * 1024,
progressCallBack,
uploadEventHandlers,
};
const readStream = fs.createReadStream(`./fileName`);
const fileObject = new StreamUpload(readStream, fileName, totalsize);
Expand All @@ -152,7 +150,7 @@ const uploadResult:UploadResult = await uploadTask.upload();
}
```

> Note: The `OneDriveLargeFileUploadTask.createTaskWithFileObject` also handles the upload session creation.**
> Note: The `OneDriveLargeFileUploadTask.createTaskWithFileObject` also handles the upload session creation.\*\*

## We can just resume the broken upload

Expand Down
Loading