BlazorFileUpload
BlazorFileUpload copied to clipboard
Make allowed types case insensitive
currently if i set the file types to .png;.jpg and i upload a .JPG it seems to fail because its not the correct type, just need to make this so it doesnt check the case sensitivity
Ok, that makes sense. I will do a ToLower() on the comparision.
Thanks for testing and finding this. I tend to use the 'Works for me' model of testing.
.Equals would work better and pass string compare with insensitivity
I just published an update and checked in the I hope fixes this.
I could rewrite this if need be, but I noticed the allowed extensions was already set to lowercase, the issue I fixed was if the uploaded file.extension is .JPG or .PNG, I did a ToLower(), because I had written a contains method originally, so I didn't have to loop through each allowed extension.
I also abort now if the file does not have an extension, and allowed extensions is true and has at least one extension set.
I don't build rockets for this very reason, but 'I think it will work' without testing.
I am going for a run now. If this doesn't fix it I will rewrite it with an equals comparison for each extension.