Forum Discussion

Kotsak's avatar
Kotsak
Copper Contributor
Feb 03, 2025

Uploading files to OneDrive Personal via API fails when filename starts with "Windows"

Hi everyone,

We've encountered a strange issue with our backup tool that affects random users. Files with names starting with "Windows" (e.g., Windows.gif) fail to upload to OneDrive Personal accounts, regardless of whether we're using:

  • Simple Item Upload (PUT request)
  • Resumable Item Upload (POST to create an upload session)

Both methods return a 404 Not Found error.

Details:

  • Simple Upload Fails after the PUT completes.
  • Resumable Upload Fails during the session creation call.
  • No issues with filenames not starting with "Windows."
  • A similar unresolved issue was reported https://github.com/OneDrive/onedrive-api-docs/issues/1785.

 

Sample Request & Response:

Simple Upload:

PUT /v1.0/drive/items/{item-id}:/Windows.gif:/content

Authorization: Bearer [token]

Host: api.onedrive.com

Response:

HTTP/1.1 404 Not Found

Payload:

json

{

  "error": {

    "code": "itemNotFound",

    "message": "Item does not exist"

  }

}

 

Resumable Upload:

bash

POST /v1.0/drive/items/{item-id}:/Windows.gif:/upload.createSession

Authorization: Bearer [token]

Content-Type: application/json

Response:

HTTP/1.1 404 Not Found

Payload:

json

{

  "error": {

    "code": "itemNotFound",

    "message": "Item does not exist"

  }

}

 

Key Observations:

  • Random Accounts Affected: Issue occurs inconsistently across different OneDrive Personal accounts.
  • No Request ID: Failed responses lack request IDs, making tracing difficult.
  • Inconsistent Reproduction: I can't reproduce it on my account, but my colleague can. Uploading the same file via the OneDrive web interface works fine.
  • Trying to force URL-encode the filename in the request results in the same error

 

Questions:

  1. Has anyone encountered this before?
  2. Could this be related to reserved keywords or API filtering rules?
  3. Any advice on debugging this further, given the lack of request IDs?

 

Thanks.

1 Reply

  • Kotsak's avatar
    Kotsak
    Copper Contributor

    Just a follow up, the problem still exists for random users. Finally, my own OneDrive Personal storage also got affected with the same issue, with the following error:

    HTTP/1.1 503 Service Unavailable

    {
        "error": {
            "code": "serviceNotAvailable",
            "message": "User content migrated. Cannot access disabled item.",
            "innererror": {
                "code": "itemDisabledDueToUserContentMigration"
            }
        }
    }

    Maybe it's safe to assume that the problem is related to the current internal migration Microsoft is conducting to all the personal OneDrive accounts?

Resources