Skip to content

How do I pass the content type of a file to Graph API in an uploadSession? #2646

Answered by Ghostbird
Ghostbird asked this question in Q&A
Discussion options

You must be logged in to vote

Whelp. I think Microsoft Graph is spectacularly unsuitable for storing files.

I'm not doing anything special. I'm just uploading an image. But the content type returned is "application/octet-stream" which is spectacularly useless.

The File documentation states

The MIME type for the file. This is determined by logic on the server and might not be the value provided when the file was uploaded. Read-only.

Read-only is evident when trying to update it with the correct content type yields:

Status Code: BadRequest
Microsoft.Graph.ServiceException: Code: notSupported
Message: Operation not supported

WHY would anyone design a file storage mechanism in such a way that it explicitly warps the f…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Ghostbird
Comment options

@Ghostbird
Comment options

Answer selected by Ghostbird
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants