I wonder how to use search().
My problem is that I have an URL to a picture, but want to know if the choosen picture is jpeg or gif format. Maby there´s a easier way to do this.
The URL comes from an '<input type=file ...>'.
Hello Andrew,
The url comes from an input used for uploading images, and every time someone uploads an image, i want to know it´s extention.
My problem is that i don´t know how to pick out this little piece of information from the string using javascript.
OK, now I understand. It's very easy.
Let's say, you have a form element named FIELD1, from which you get filenames.
In order to receive file extentions you have to get last 3 chars of a string:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.