determine if file name has 2 dots in it
Posted: Sun Oct 10, 2010 8:56 pm
My uploader allows the following file formats:
jpg
pdf
gif
png
I tested that if someone was to name a file configure.php.jpg, my uploader allows it to upload
I want to do a check to see if the user has 2 extensions, and if so it will not allow them to upload.
I was thinking of just checking if the file name has two "." (dots) in the name. What function could I use to do this?
Or .. is there a better way?
jpg
gif
png
I tested that if someone was to name a file configure.php.jpg, my uploader allows it to upload
I want to do a check to see if the user has 2 extensions, and if so it will not allow them to upload.
I was thinking of just checking if the file name has two "." (dots) in the name. What function could I use to do this?
Or .. is there a better way?