Skip to content

Large file upload task - Add UploadResult object #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 16 additions & 0 deletions docs/tasks/LargeFileUploadTask.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,19 @@ async function largeFileUpload(client, file) {
}
}
```

## Cancelling a largeFileUpload task

_Cancelling an upload session sends a DELETE request to the upload session URL_

```typescript
const cancelResponse = await uploadTask.cancel();
```

## Get the largeFileUpload session

_Returns the largeFileUpload session information containing the URL, expiry date and cancellation status of the task_

```typescript
const uploadsession: LargeFileUploadSession = uploadTask.getUploadSession();
```
4 changes: 2 additions & 2 deletions src/middleware/AuthenticationHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ export class AuthenticationHandler implements Middleware {
}
let authenticationProvider: AuthenticationProvider;
let authenticationProviderOptions: AuthenticationProviderOptions;
if (typeof options !== "undefined") {
if (options) {
authenticationProvider = options.authenticationProvider;
authenticationProviderOptions = options.authenticationProviderOptions;
}
if (typeof authenticationProvider === "undefined") {
if (!authenticationProvider) {
authenticationProvider = this.authenticationProvider;
}
const token: string = await authenticationProvider.getAccessToken(authenticationProviderOptions);
Expand Down