SageFix. LetsFix!  
Current Location : Home > Web Development > JavaScript > Detecting upload file size ala gmail Share/Save/Bookmark    

Main Menu
SageFix - Let's Fix

Board Categories
    Web Site Designing
- Graphics
    Web Development
- .NET
- Classic ASP
- JavaScript
- PHP
    WebSite Management
- Promotion Techniques
- Search Engine Optimization
    Databases
- MySQL

Tutorials

Database Connection Strings

  Contact Us


 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?

 
      Apr 21, 2009, 03:12 4
  
bump?

 
      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]  









Subscribe to our mailing list
email


Current Location : Home > Web Development > JavaScript > Detecting upload file size ala gmail Share/Save/Bookmark    

Development problem? SageFix is completely free -- paid for by advertisers and donations. Click here to Contact Us If you have any query. Enjoy!
Request processed in 7.0E-5 seconds Home - Contact Us - Terms Of Service - Privacy Policy - Copyrights - Top
Advertisements do not imply our endorsement of that product or service.
Current server time now is 09-Sep-2010 09:51:00
Copyright © 2009 Sagefix Inc. All rights reserved.
Powered By SageFix