1

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

maztt
  • 12,278
  • 21
  • 78
  • 153

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
  • 623,446
  • 136
  • 1,297
  • 1,155
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
  • 24,079
  • 20
  • 92
  • 147