Repository navigation
Conversation
Blocks identified by upload IDs: - Send only the data of the last block instead of the whole buffer, which padded the uploaded file with leftover data from the previous block. - Round the number of blocks up. A size that divided evenly by the block size gave one block too many, so MFWS never saw the last block. - Add UploadTemporaryFileBlock[Async] overloads that take the block size, so a shorter last block can be uploaded. Reject offsets that are not at a block boundary and blocks larger than the block size. - Read each block fully from the stream. File names: - Parse the file name once into a title and an extension without the dot (GetFileTitle, GetFileExtension), as M-Files expects. Replaces the separate dot removal in UploadFiles and UploadTemporaryFileBlockBegin, and the dotted extension in UploadTemporaryFileInBlocks. UploadFiles no longer throws for a file without an extension. - UploadTemporaryFileInBlocks returns the title, extension and size with the upload ID, instead of the last block response which had neither a title nor an extension. Tests: close test.txt after creating it, which made the upload tests fail on a clean run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NuGet trusted publishing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes bugs in the upload-ID block upload and in how file names are split into a title and an extension.
Block uploads (upload IDs)
UploadTemporaryFileBlock[Async]overloads take the block size, so a shorter last block can be uploaded. The existing overloads call them with the block's own length.File names
GetFileTitle,GetFileExtension). These replace the separate dot removal inUploadFilesandUploadTemporaryFileBlockBegin(FileInfo), and fixUploadTemporaryFileInBlocks, which sent.pdfinstead ofpdf.UploadFilesno longer throws for a file without an extension; it returns an empty extension.UploadTemporaryFileInBlocksnow returns the title, extension and size along with the upload ID, so the result can be used to create an object. Before, it returned the last block's response, which had no title or extension.Tests
test.txtafter creating it. Before this, 10 tests failed on a clean run.Testing
test.txtdeleted).Note
This conflicts with #40 (CFO-1997) in the block loop of
UploadTemporaryFileInBlocksAsync. Whichever merges second needs to resolve it.🤖 Generated with Claude Code