I am attempting to upload a file to a SharePoint library where the number of items in the library exceeds the threshold (5000).
When creating an upload session for a resumable upload...
https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{itemId}/createUploadSession
...this works perfectly well except when the file already exists, then I am presented with a 404.
{
"error": {
"code": "itemNotFound",
"message": "The resource could not be found.",
"innerError": {
"request-id": "6f31b3ee-2003-43aa-8956-99c82367c770",
"date": "2018-02-13T01:29:41"
}
}
}
I have also tried
https://graph.microsoft.com/v1.0/drive/items/{itemId}/createUploadSession
https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{parent-id}:/{filename}/createUploadSession
The documentation says to Handle 404 Not Found errors when doing resumable uploads by starting the entire upload over. This indicates the upload session no longer exists. But I am getting the error when attempting to create the upload session, so I don't believe this statement to be true.
This still occurs when "@microsoft.graph.conflictBehavior": "rename"
is set in the body.
If I switch to using the standard upload...
https://graph.microsoft.com/v1.0/drives/{drive-id}/items/{parent-id}:/{filename}:/content
... it will overwrite the file without error, except that the maximum file size is 4MB, which is pretty limiting.