Operation not supported response when create upload session

howard tseng 1 Reputation point
2022-10-04T09:32:28.48+00:00

Hi,
I try to add a file ( Untitled Section.one ), which has already exist, to an onenote folder.
When I create an upload session by

   POST /drives/{driveId}/items/{itemId}:/Untitled Section.one:/createUploadSession  
   {  
     "item": {  
       "@microsoft.graph.conflictBehavior": "replace"  
     }  
   }  

I get the error like this

   {  
       "error": {  
           "code": "notSupported",  
           "message": "Operation not supported",  
           "innerError": {  
               "date": "2022-10-04T09:21:52",  
               "request-id": "55e80bf0-2800-45f5-9bf7-92d9172bfbdd",  
               "client-request-id": "55e80bf0-2800-45f5-9bf7-92d9172bfbdd"  
           }  
       }  
   }  

I expect the new file can overwirte the old one without any error. I wonder if there is a way to do it.
Thank you.

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Srinivasa Rao Darna 6,846 Reputation points Microsoft External Staff
    2022-10-04T17:44:55.207+00:00

    Hi @howard tseng ,

    As per my test, using driveitem-createuploadsession on user OneDrive is working fine for .one file extentions.

    POST /me/drive/{file-relative-path}:/createUploadSession  
    {  
    "item": {  
    "@microsoft.graph.conflictBehavior": "replace"  
    }  
    }  
    

    247363-image.png

    Usage of the is returning 400 Operation not supported error when using with SharePoint libraries.

    POST /sites/{site-id}/drive/{file-relative-path}:/createUploadSession  
    {  
    "item": {  
    "@microsoft.graph.conflictBehavior": "replace"  
    }  
    }  
    

    247404-image.png

    It appears there is some issue with POST /sites/{siteId}/drive/items/{itemId}/createUploadSession for SharePoint libraries is not working with OneNote(.one) files only. Below is a test with .png files
    247506-image.png

    As it additional troubleshooting, request you to report this by raising a support case a specialized support engineer will assist you better on this.

    You can raise technical support request from
    https://portal.azure.com/#view/Microsoft_Azure_Support/HelpAndSupportBlade/~/overview or https://admin.microsoft.com/#/support/requests.

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


Your answer

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