jquery - the input file type image size restriction is not working -
Actually i tried jquery image file verification with this url, but this is not working. Can you confirm and advise me?
Click here:
& lt; Form method = "post" enctype = "multipart / form-data" id = "upload_form" & gt; & Lt; Input type = "file" name = "example_file" name = "example_file" & gt; & Lt; Button type = "submit" & gt; Upload & lt; / Button & gt; & Lt; / Form & gt; & Lt; Script src = "// ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> & Lt; Script src = "https://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; Validate ({Rule: {example_file: {fileType: {types: ["text", "gzip", "zip"]}, maxFileSize: {"unit" "KB", "size": 100}, minFileSize: {"unit": "KB", "size": "10"}}})}} & lt; / scripts & gt; < / Pre>
If you want to use the extension so that not enough to be just including jquery and jquery.validate. Add the plugin also by downloading (I know that this is missing in the example)
The last solution should be something like this:
< / Pre>Edit: Testing of uploadfunction in jsfiddle is not the best idea, cuz does not normally allow file uploads.
Comments
Post a Comment