/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if (! (extension && /^(jpg|png|jpeg|gif|zip|xls|xlsx|csv|txt|tif|tiff|pdf|doc|eps)$/.test(extension))){ // extension is not allowed $("<span class='error'>Error: Not a valid file extension</span>").appendTo("#file_holder .files"); // cancel upload return false; }