Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Warn the user a file is too big before the upload

To increase user experience, I would like to warn the user that the file is too big (let's say > 8M) before sending the whole file (which may take some time due to the size and the client connection). All kind of fields can be "pre-validated" client-side for a better user experience, but I'm stuck on the file size problem.

Is there a solution to this problem?

[edit] I'm also open to APC for PHP, which features the rfc 1867. I'm not sure if it's possible to cancel the form upload if we detect the size is too big. I certainly will award bounty if someone show me how to do it.

like image 315
Savageman Avatar asked Aug 30 '10 11:08

Savageman


1 Answers

How about this Flash based uploader? http://swfupload.org/

This seems compelling

  • Degrades gracefully to normal HTML upload form if Flash or javascript is unavailable
  • Control filesize before upload starts

Since it's open source if you were keen you could combine the graceful degradation with the other HTML5 and IE only solutions to cover most browser installs: http://code.google.com/p/swfupload/

like image 125
Matthew Lock Avatar answered Oct 21 '22 13:10

Matthew Lock