This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.Parsley | |
.addValidator('filemaxsize', { | |
requirementType: 'string', | |
validateString: function (val, req){ | |
var reqs = req.split('|'); | |
var input = $('input[type="file"][name="'+reqs[0]+'"]'); | |
console.log(reqs[0], reqs[1]); | |
var maxsize = reqs[1]; | |
var max_bytes = maxsize * 1000000, file = input.prop('files')[0]; | |
return file.size <= max_bytes; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am acmartinsalmeida on github. | |
* I am acmartinsalmeida (https://keybase.io/acmartinsalmeida) on keybase. | |
* I have a public key ASBBsu27B9x1ysIZyhxz0eL2mfM5lu86gFMYR4xMZlopcAo | |
To claim this, I am signing this object: |