MrChubOo
MrChubOo

Reputation: 13

Is it possible to upload file larger than 60mb using MS graph API?

I'm trying to upload files (e.g. xx.pdf (70mb) in MS Teams channel using MS Graph API v1.0. but it fails if more than 60mb. is there a way to do it?

Upvotes: 1

Views: 1208

Answers (1)

Tom
Tom

Reputation: 890

Yes, upload the file in chunks with each chunk being less than 60MB:

Upload bytes to the upload session To upload the file, or a portion of the file, your app makes a PUT request to the uploadUrl value received in the createUploadSession response. You can upload the entire file, or split the file into multiple byte ranges, as long as the maximum bytes in any given request is less than 60 MiB.

The fragments of the file must be uploaded sequentially in order. Uploading fragments out of order will result in an error.

Note: If your app splits a file into multiple byte ranges, the size of each byte range MUST be a multiple of 320 KiB (327,680 bytes). Using a fragment size that does not divide evenly by 320 KiB will result in errors committing some files.

https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0

Upvotes: 2

Related Questions