BlazorFileUpload icon indicating copy to clipboard operation
BlazorFileUpload copied to clipboard

Error not showing when wrong type is uploaded and nothing happens second time

Open zoinkydoink opened this issue 4 years ago • 2 comments

When a file is uploaded that is of the wrong extension, the error message set does not show (assuming it should show). However what is happening is that an exception is thrown and it is set on the .HasException. Is it expected that we handle this ourselves? if so then is there a point to CustomExtensionMessage.

If i upload the same bad extension file again after the first one fails, the second try doesnt even throw an exception, it just simple does nothing. However if i upload a good file after a bad attempt then everything works as expected.

Here is the code I am using

   <FileUpload ResetButtonText="Upload another" OnChange="OnFileUploaded"
                PartialGuidLength="10" MaxFileSize="800000" 
                FilterByExtension="true" AllowedExtensions=".jpg;.png" ShowStatus="true"
                CustomExtensionMessage="Wrong extension" AppendPartialGuid="true"
                FileTooLargeMessage="file too large"></FileUpload>

I am also using the latest version from nuget

zoinkydoink avatar Mar 08 '20 17:03 zoinkydoink

No you are not supposed to have to handle yourself, the message should show, or you can set a variable like status and show it yourself.

I have to admit though, I only tested trying to upload the wrong type once in a row; I realize 99% of all errors happen between keyboard and chair so the system should also work for slow learning users.

I know this doesn't help solve your problem, but I do like this feedback::

However if i upload a good file after a bad attempt then everything works as expected.

I just got back from jogging, let me eat lunch and shower and I will look and this and the Auto Reset issue. I had to some actual paying work this week, even though the code I get paid to work on is so boring.

Give me a few hours I will see what I can come up with.

Thanks,

Corby

DataJuggler avatar Mar 08 '20 19:03 DataJuggler

Thanks for looking into this, i am using this in a small app so i am trying to test this control as much as possible since I will be using this in a bigger project so any problem i come across i will let you know.

zoinkydoink avatar Mar 08 '20 20:03 zoinkydoink