0

How can I get the size of a file using JavaScript (preferably using MooTools 1.2)?

Dominic Rodger
  • 97,747
  • 36
  • 197
  • 212
Avinash
  • 6,064
  • 15
  • 62
  • 95

2 Answers2

2

If you're talking about the size of a file provided to an <input> tag of type "file", or a file whose path your web application happens to know, well, you can't except in some very particular cases (like a page loaded from a "file://" URL).

Pointy
  • 405,095
  • 59
  • 585
  • 614
0

How can I get the size of a file using JavaScript (preferably using MooTools 1.2)?

Local or remote?

If it's remote, I would do an HTTP HEAD request and check the Content-Length field.

Jonathon Faust
  • 12,396
  • 4
  • 50
  • 63