-
Notifications
You must be signed in to change notification settings - Fork 252
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
"Must provide stream that can read and seek" Large File attachment. #2249
Comments
Thanks for raising this @Ofer-Gal For performance reasons, the stream returned by the As in this scenario, you need a buffered stream, any chance the suggestion below works for you? Stream memStream = await _graphClient.Drives["drive-id"].Items["drive-item-id"].Content.GetAsync();
using var bufferedStream = new MemoryStream();
await memStream.CopyToAsync(bufferedStream);//buffer the stream so that its seekable.
var fileUploadTask = new LargeFileUploadTask<DriveItem>(uploadSession, bufferedStream, maxSliceSize); |
This works fine thank you. |
@andrueastman How can we use such a stream on this endpoint to upload a large file ? `using (var httpResponse = await httpClientStorageService.GetAsync(downloadStorageServiceURLPath, HttpCompletionOption.ResponseHeadersRead))
|
To Reproduce In an Azure Function
Steps to reproduce the behavior:
Stream memStream = await _graphClient.Drives[drive.Id].Items[driveItem.Id].Content.GetAsync();
var uploadSession = await _graphClient.Users[sender].Messages[draft.Id].Attachments.CreateUploadSession.PostAsync(requestBody);
var fileUploadTask = new LargeFileUploadTask<DriveItem>(uploadSession, fileStream, maxSliceSize);
Expected behavior
Create the task and continue upload like this code has done in the last year
Desktop (please complete the following information):
Additional context
Seems the upload expects a FileStream but the "Download" returns a Memory Stream (Which was OK until few days ago)
I did not find a way to create a FileStream without saving to disk. I have no disk in an Azure Function.
Thanks.
The text was updated successfully, but these errors were encountered: