开发者

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

开发者 https://www.devze.com 2022-12-26 00:51 出处:网络
How can I get the size of a file using JavaScript (preferably using MooTools 1.开发者_高级运维2)?If you\'re talking about the size of a file provided to an <input> tag of type \"file\", or a fil

How can I get the size of a file using JavaScript (preferably using MooTools 1.开发者_高级运维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).


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消