Reputation: 12294
Is there any way to check the size of the file when it is about to be uploaded with jquery ?
Upvotes: 1
Views: 1335
Reputation: 24515
Have a look at the jQuery Uploadify plugin. It can check file sizes, but it uses flash internally to get this info.
Upvotes: 1
Reputation: 630389
You can't do this with jQuery...or with JavaScript at all :) Mainly for security reasons you can't allowed to do most things with files (at least using only JavaScript).
However there are non-pure-JS alternatives that may be an option, like SWF Upload, Uploadify, fancyupload, etc.
There's a question here with a decent list of alternatives available.
Upvotes: 1