Upload large files with an upload session API issues.

Kuldeep Kushwaha 1 Reputation point
2020-07-31T14:34:06.523+00:00

Hi,

We are using 'Upload large files with an upload session' REST API call (https://video2.skills-academy.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0#create-an-upload-session) in order to upload large files. We are facing two issues in the API call.

1) Below is our API call to create an upload session on root level.
POST "https://graph.microsoft.com/v1.0/drives/{mydrive}/items/{myitem}/createUploadSession".
We use all three options in '@microsoft.graph.conflictBehavior', none of them are working.

Request Body below
{
"item": {
"@microsoft.graph.conflictBehavior": "rename"
},
"deferCommit": true
}

we are getting the below error with '400 Bad Request' in response.
{
"error": {
"code": "invalidRequest",
"message": "A valid path must be provided.",
"innerError": {
"date": "2020-07-31T12:38:13",
"request-id": "9cfec898-69f8-47b8-a480-a6ac6dc28c40"
}
}
}

But when we use GET "https://graph.microsoft.com/v1.0/drives/{mydrive}/items/{myitem}", we are getting proper {myitems} details with 200 statuscode.

2) Below is our API call to create an upload session inside the root.
POST "https://graph.microsoft.com/v1.0/drives/{mydrive}/items/{myitem}/createUploadSession"
here {myitem} is a folder ID inside of root.
We use all three options in '@microsoft.graph.conflictBehavior', only 'rename' is working and giving 200 status code as well as proper response mentioned in the documentation, but 'fail' and 'replace' are not working.

Request Body below:
{
"item": {
"@microsoft.graph.conflictBehavior": "fail"
},
"deferCommit": true
}

we are getting the below error with '409 Conflict' in response.
{
"error": {
"code": "nameAlreadyExists",
"message": "Cannot create an upload session on a folder",
"innerError": {
"date": "2020-07-31T14:19:29",
"request-id": "1b197976-f99b-493b-b75a-d3a302485d5d"
}
}
}

But when we use GET "https://graph.microsoft.com/v1.0/drives/{mydrive}/items/{myitem}", we are getting proper {myitems} details with 200 statuscode.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,420 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 36,836 Reputation points Microsoft Employee
    2020-08-04T22:46:23.073+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.