Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make allowed types case insensitive #13

Open
zoinkydoink opened this issue Mar 6, 2020 · 3 comments
Open

Make allowed types case insensitive #13

zoinkydoink opened this issue Mar 6, 2020 · 3 comments

Comments

@zoinkydoink
Copy link

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

@DataJuggler
Copy link
Owner

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.

@zoinkydoink
Copy link
Author

.Equals would work better and pass string compare with insensitivity

@DataJuggler
Copy link
Owner

DataJuggler commented Mar 6, 2020

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.

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

No branches or pull requests

2 participants