|
| 1 - 5 of 5 [Total 1 Pages] |
|
|
Detecting upload file size ala gmail Apr 17, 2009, 11:47 |
1 |
|
It's an old question "how do I detect a file's" size client side - before I upload it? And i always thought the answer was a simple "you can't".
But I'm on gmail today and try to send a massive file, only to be told instantly that the file is too big. Anyone know how they do this? Is it JS or maybe an applet?
|
|
|
Apr 17, 2009, 13:00 |
2 |
|
Does it tell you that message before or after you submit the form with the mail? If after, the size of a file you're uploading is probably part of the HTTP headers (Content-Length) sent with the request. A little back-and-forth AJAX style could get the message back to you that the HTTP connection was closed because the content-length was too large.
|
|
|
Apr 17, 2009, 13:31 |
3 |
|
well it gives you the message as soon as you've selected your file, at which point it starts normally starts uploading the file.
However, checking in firebug, it shows NO network communication during the time between me selecting the file, and gmail reporting the file's too big. And the response is so quick it doesn't look like it's sending anything.
Any other ideas? Is it possible for JS to check the headers BEFORE sending?
|
|
|
Jul 14, 2009, 11:46 |
5 |
|
Finnally stumbled upon the answer - there's some flash doing it - that's why there was no network communication.
Another mystery solved...
|
|
| 1 - 5 of 5 [Total 1 Pages] |
|
|
|