Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

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

Open
git37 opened this issue May 31, 2020 · 7 comments
Open

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

git37 opened this issue May 31, 2020 · 7 comments

Comments

@git37
Copy link

git37 commented May 31, 2020

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.

@marinasundstrom
Copy link

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

@andrew-gaston
Copy link

andrew-gaston commented Jun 12, 2020

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

@arvindram11
Copy link

arvindram11 commented Jun 15, 2020

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

@SaebAmini
Copy link

Same issue happening for me on version 0.2.0

@baartho
Copy link

baartho commented Aug 31, 2020

I'm also facing this issue on 0.2.0

@marinasundstrom
Copy link

marinasundstrom commented Aug 31, 2020

InputFile is part of Blazor now.

dotnet/aspnetcore#24640

@zboyles
Copy link

zboyles commented Oct 2, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants