Hi Chen, Nyon-ZL,
Thanks for reaching out to Microsoft!
400 error occurs when the request can't be processed because it's malformed or incorrect.
Graph API to upload files to SharePoint drive:
PUT /sites/{site-id}/drive/items/{parent-id}:/{filename}:/content
If you want to upload large files, you can upload large files with an upload session, please try to use the following Graph API to create an upload session:
POST /sites/{siteId}/drive/items/{itemId}/createUploadSession
Upload small files: Upload or replace the contents of a DriveItem (Note: This method only supports files up to 4MB in size.)
Upload large files: Upload large files with an upload session
Ensure that the Graph API is valid to upload files.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.