1

Is there any way to check the size of the file when it is about to be uploaded with jquery ?

maztt
  • 12,167
  • 19
  • 75
  • 149

2 Answers2

1

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.

Community
  • 1
  • 1
Nick Craver
  • 610,884
  • 134
  • 1,288
  • 1,151
1

Have a look at the jQuery Uploadify plugin. It can check file sizes, but it uses flash internally to get this info.

Mark Redman
  • 23,351
  • 20
  • 92
  • 141