microsoftgraph / microsoftgraph/msgraph-sdk-dotnet-core
LargeFileUploadTask unable to upload taskFileAttachment
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 164
- Forks
- 65
- Avg merge
- 38m
- Merged PRs (30d)
- 1
Description
Please provide the following (and please check them off the list with [x]) before submitting this issue:
- Expected behavior. Please provide links to the specific Microsoft Graph documentation you used to determine the expected behavior.
- Actual behavior. Provide error codes, stack information, and a Fiddler capture of the request and response (please remove personally identifiable information before posting).
- Steps to reproduce the behavior. Include your code, IDE versions, client library versions, and any other information that might be helpful to understand your scenario.
Expected behavior
Use LargeFileUploadTask to upload a file to TodoTask Attachment.
public static AttachmentSession UploadAttachment(string tasklistid, string taskid, AttachmentInfo attachmentInfo, Stream ms)
{
var attachmentsRequestBuilder = client.Me.Todo.Lists[$"{tasklistid}"].Tasks[$"{taskid}"].Attachments;
var uploadSession = attachmentsRequestBuilder.CreateUploadSession(attachmentInfo).Request().PostAsync().Result;
var task = new LargeFileUploadTask<AttachmentSession>(uploadSession, ms, 12 * 320 * 1024, client);
var res = task.UploadAsync().Result;
return res.ItemResponse;
}
As this document illustrates, first we need to create an upload session. Here's an example of returned uploadUrl
https://graph.microsoft.com/beta/users/6f9a2a92-8527-4d64-837e-b5312852f36d/todo/lists/AAMDiFkfh=/tasks/AAMkADliMm=/attachmentSessions/AAMkADliMm=
Then we should use the upload session to upload (to /content)
PUT https://graph.microsoft.com/beta/users/6f9a2a92-8527-4d64-837e-b5312852f36d/todo/lists/AAMDiFkfh=/tasks/AAMkADliMm=/attachmentSessions/AAMkADliMm=/content
But the LargeFileUploadTask creates a request with WRONG URL
PUT https://graph.microsoft.com/beta/users/6f9a2a92-8527-4d64-837e-b5312852f36d/todo/lists/AAMDiFkfh=/tasks/AAMkADliMm=/attachmentSessions/AAMkADliMm=
Actual behavior
The data is expected to be uploaded to /attachmentSessions/AAMkADliMm=/content but not /attachmentSessions/AAMkADliMm=
Steps to reproduce the behavior
As said above, use LargeFileUploadTask to upload a file to TodoTask Attachment.
Screenshots



Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with LargeFileUploadTask and its UploadAsync entry point, then compare the upload session URL used by the task with the Microsoft Graph Todo attachment documentation. Reproduce the TodoTask attachment upload and verify that the request targets the documented /content endpoint and completes successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100