Fixes for FileUpload component#338
Merged
csharpfritz merged 9 commits intoFritzAndFriends:devfrom Feb 10, 2026
Merged
Conversation
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
Session: 2026-02-10-sprint1-kickoff Requested by: Jeffrey T. Fritz Changes: - logged session to .ai-team/log/2026-02-10-sprint1-kickoff.md - merged 6 decisions from inbox into decisions.md - deduplicated CalendarSelectionMode decisions (Forge + Cyclops consolidated) - propagated updates to agent history files (cyclops, jubilee, beast, forge, rogue) - deleted processed inbox files
…ritzAndFriends#335) SHIP-BLOCKING BUG FIX: The @onchange binding on <input type='file'> received ChangeEventArgs (no file data), NOT InputFileChangeEventArgs. This meant _currentFile was NEVER populated and HasFile always returned false. Changes: - Replace raw <input type='file'> with Blazor's InputFile component - OnFileChangeInternal now receives InputFileChangeEventArgs with IBrowserFile - _currentFile and _currentFiles properly populated on file selection - HasFile, FileName, FileBytes, FileContent, PostedFile all work correctly - SaveAs() uses Path.GetFileName() to prevent rooted path injection - SaveAllFiles() validates resolved path stays within target directory - _currentFiles is now readonly (security scan fix) - Added HasFiles (plural) property for multi-file detection (Web Forms API) - Removed unused IJSRuntime injection and ElementReference - Updated docs to reflect InputFile usage and HasFiles property
| // Sanitize: ensure the filename cannot escape the intended directory | ||
| var safeFileName = Path.GetFileName(filename); | ||
| var directory = Path.GetDirectoryName(filename); | ||
| var safePath = string.IsNullOrEmpty(directory) ? safeFileName : Path.Combine(directory, safeFileName); |
Check notice
Code scanning / CodeQL
Call to 'System.IO.Path.Combine' may silently drop its earlier arguments Note
| // Sanitize filename to prevent directory traversal attacks | ||
| var safeFileName = Path.GetFileName(file.Name); | ||
| var path = Path.Combine(directory, safeFileName); | ||
| var fullPath = Path.GetFullPath(Path.Combine(directory, safeFileName)); |
Check notice
Code scanning / CodeQL
Call to 'System.IO.Path.Combine' may silently drop its earlier arguments Note
| // Sanitize: ensure the filename cannot escape the intended directory | ||
| var safeFileName = Path.GetFileName(filename); | ||
| var directory = Path.GetDirectoryName(filename); | ||
| var safePath = string.IsNullOrEmpty(directory) ? safeFileName : Path.Combine(directory, safeFileName); |
Check notice
Code scanning / CodeQL
Call to 'System.IO.Path.Combine' may silently drop its earlier arguments Note
csharpfritz
added a commit
to csharpfritz/BlazorWebFormsComponents
that referenced
this pull request
Feb 10, 2026
…Friends#338 merge The FileUpload PR (FritzAndFriends#338) inadvertently reverted Sprint 1 gate review entries from agent histories (beast, cyclops, forge, jubilee, rogue) and downgraded the FileUpload InputFile decision in decisions.md. Restored from commit f85aa42 (docs(ai-team): Sprint 1 gate review results).
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.
No description provided.