BlazorInputFile
BlazorInputFile copied to clipboard
message "no file chosen/selected" even after file is selected
ServerSide Blazor, v0.2.0 Both Chrome+FF
in the past few days, the file is selected OK, but the message "no file chosen" (selected on FF) remains, both on chrome and FF.
For me it is even not selected. Older versions work fine.
I am using the WebAssembly version and a workaround I found is to slightly modify the inputfile.js file. I commented out elem.value = '' and it seemed to do the trick.
componentInstance.invokeMethodAsync('NotifyChange', fileList).then(function () {
//reset file value ,otherwise, the same filename will not be trigger change event again
elem.value = '';
I have the same issue as well. I am currently implementing a workaround by surrounding the InputFile in a div with style display:none and using a regular button to send the click message.
div style="display:none" InputFile id="myButton" OnChange="HandleSelection" /div button class="btn-primary" onclick="document.getElementById('myButton').click()" Browse... /button
Same issue happening for me on version 0.2.0
I'm also facing this issue on 0.2.0
InputFile is part of Blazor now.
https://github.com/dotnet/aspnetcore/pull/24640
You can just alter the control like in the drag and drop example page/css or here's a good post on styling input type=files: Styling an input type=“file” button