-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot upload file into OneDrive (content type error) #1276
Comments
I've changed my code so that it sets content type explicitly: const filename = 'file.csv';
const content = 'content';
await.client.api(`/drives/${this.driveId}/items/${this.folderId}:/${filename}:/content`)
.headers({'Content-Type': 'text/plain'})
.put(content); The request now matches documentation, but I still get an error:
|
@koros, can you have a look? |
Hi @jakubriegel have you solved the problem? |
@vladtsit No, as this issue needs to be resolved on library level. But I have a workaround. I used https://learn.microsoft.com/pl-pl/onedrive/developer/rest-api/api/driveitem_createuploadsession?view=odsp-graph-online. I create an upload url with the |
Im facing the same issue, any progress so far? |
Bug Report
Prerequisites
For more information, see the
CONTRIBUTING
guide.Description
Cannot make a PUT request to upload file into OneDrive. The API returns
Unable to read JSON request payload
error. The docs here say to usetext/plain
content type, but the library here has it hardcoded to JSON.Console Errors: [Is there any console error]
Screenshots: [If applicable, add screenshots to help explain your problem]
Steps to Reproduce
Expected behavior: PUT is succesfully sent and file is uploaded
Actual behavior: PUT was sent with invalid content type
Additional Context
Add any other context about the problem here..
Usage Information
check log above
The text was updated successfully, but these errors were encountered: