Skip to content

How to create an upload session? #874

Answered by shemogumbe
paulschmeida asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @paulschmeida thanks for using the SDK and for asking this.

To create an upload session, we use the CreateUploadSessionPostRequestBody
It takes DriveItemUploadableProperties

Examples:

from msgraph.generated.drives.item.items.item.create_upload_session.create_upload_session_post_request_body import CreateUploadSessionPostRequestBody
from msgraph.generated.models.drive_item_uploadable_properties import DriveItemUploadableProperties

destination_path = "my_docs/test_upload_file.txt"
file_path = "C:/Users/<path-to>/Project_workbook.xlsx"
async def upload_file():
    uploadable_properties = DriveItemUploadableProperties(
        additional_data={'@microsoft.graph.conflictBehavior': 'repl…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shemogumbe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
documentation Improvements or additions to documentation
2 participants
Converted from issue

This discussion was converted from issue #610 on August 26, 2024 14:20.