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
3 changes: 3 additions & 0 deletions src/tasks/LargeFileUploadTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class LargeFileUploadTask<T> {
* @async
* Makes request to the server to create an upload session
* @param {Client} client - The GraphClient instance
* @param {string} requestUrl - The URL to create the upload session
* @param {any} payload - The payload that needs to be sent
* @param {KeyValuePairObjectStringNumber} headers - The headers that needs to be sent
* @returns The promise that resolves to LargeFileUploadSession
Expand Down Expand Up @@ -295,6 +296,7 @@ export class LargeFileUploadTask<T> {
.headers({
"Content-Length": `${range.maxValue - range.minValue + 1}`,
"Content-Range": `bytes ${range.minValue}-${range.maxValue}/${totalSize}`,
"Content-Type": "application/octet-stream",
})
.put(fileSlice);
}
Expand All @@ -314,6 +316,7 @@ export class LargeFileUploadTask<T> {
.headers({
"Content-Length": `${range.maxValue - range.minValue + 1}`,
"Content-Range": `bytes ${range.minValue}-${range.maxValue}/${totalSize}`,
"Content-Type": "application/octet-stream",
})
.responseType(ResponseType.RAW)
.put(fileSlice);
Expand Down
5 changes: 3 additions & 2 deletions src/tasks/OneDriveLargeFileUploadTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import { getValidRangeSize } from "./OneDriveLargeFileUploadTaskUtil";
* @property {string} fileName - Specifies the name of a file to be uploaded (with extension)
* @property {string} [path] - The path to which the file needs to be uploaded
* @property {number} [rangeSize] - Specifies the range chunk size
* @property {string} [conflictBehavior] - Conflict behaviour option
* @property {UploadEventHandlers} [uploadEventHandlers] - UploadEventHandlers attached to an upload task
*/
export interface OneDriveLargeFileUploadOptions {
fileName: string;
Expand All @@ -35,8 +37,7 @@ export interface OneDriveLargeFileUploadOptions {
* @interface
* Signature to define options when creating an upload task
* @property {string} fileName - Specifies the name of a file to be uploaded (with extension)
* @property {string} [path] - The path to which the file needs to be uploaded
* @property {number} [rangeSize] - Specifies the range chunk size
* @property {string} [conflictBehavior] - Conflict behaviour option
*/
interface OneDriveFileUploadSessionPayLoad {
fileName: string;
Expand Down