BlazorInputFile icon indicating copy to clipboard operation
BlazorInputFile copied to clipboard

message "no file chosen/selected" even after file is selected

Open git37 opened this issue 4 years ago • 7 comments

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.

git37 avatar May 31 '20 11:05 git37

For me it is even not selected. Older versions work fine.

marinasundstrom avatar Jun 02 '20 20:06 marinasundstrom

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 = '';

andrew-gaston avatar Jun 12 '20 18:06 andrew-gaston

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

arvindram11 avatar Jun 15 '20 01:06 arvindram11

Same issue happening for me on version 0.2.0

SaebAmini avatar Jul 04 '20 03:07 SaebAmini

I'm also facing this issue on 0.2.0

baartho avatar Aug 31 '20 20:08 baartho

InputFile is part of Blazor now.

https://github.com/dotnet/aspnetcore/pull/24640

marinasundstrom avatar Aug 31 '20 20:08 marinasundstrom

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

zboyles avatar Oct 02 '20 00:10 zboyles