I need to validate .xls and .xlsx files only. If any other file has been given, it should give an errror message. (example:file_name.exe.xls). How do I validate it through jquery?
Asked
Active
Viewed 845 times
0
-
There is a way to do it. It's by writing some code :) – Sudhansu Choudhary Dec 08 '16 at 10:05
-
1@SudhansuChoudhary maje le rahe ho – Atul Sharma Dec 08 '16 at 10:06
-
1@atulquest93 ab aur kya bol sakte hain.. pehle efforts toh daalna hain na inhe.. tabto kuch baat banega inka – Sudhansu Choudhary Dec 08 '16 at 10:07
-
@atulquest93 i chequed reference link and i tested with file_name.exe.jpg still it is taking the input..it is not giving error message – bala chandra Dec 08 '16 at 10:41
-
@balachandra check this `https://jsfiddle.net/gabrieleromanato/QWQdz/` – Atul Sharma Dec 08 '16 at 12:21
-
@atulquest93 i tried the above link still no luck. when i uploading this extension (notepad.exe%00.jpg), it is giving success message.but it is a .exe file it must not accept.Any help Appreciated. Thanks! – bala chandra Dec 08 '16 at 19:00
-
In java i can do it like String name = "notepad.exe%00.jpg"; if (name.contains(".exe")) { System.out.println("error"); } else { System.out.println("success"); } – bala chandra Dec 08 '16 at 19:02
-
the above program how to do it in javascript or jquery – bala chandra Dec 08 '16 at 19:03