That will be the HTML5 FileReader Api. Too bad it is not supported in IE9
and Opera. But it would awesome to see wicket support for that because it
would give a better user experience in Chrome and FF.

Attila

2011/3/18 John Owen <jo...@globalscape.com>

> There are some javascript-based solutions that can check the file info
> (size, extensions, etc.) before transmitting the file(s). The downside is
> that they don't work in IE (up to IE 8).
>
> The example I found most useful is here: http://valums.com/ajax-upload/
>
> Regards
>
> -----Original Message-----
> From: Henrique Boregio [mailto:hbore...@gmail.com]
> Sent: Thursday, March 17, 2011 10:00 PM
> To: users@wicket.apache.org
> Subject: FileUpload size limit
>
> Hi, how can I restrict the size of a file being uploaded, before it gets
> uploaded?
>
> The following code does not work, since wicket first uploads the file to
> the
> server, THEN checks its size (I've tried it uploading a 1Gig file):
>
>       protected void onSubmit() {
>
>            final FileUpload upload = fileUploadField.getFileUpload();
>
>            if (upload != null) {
>             if(upload.getSize() > Bytes.kilobytes(150).bytes()) {
>             return;
>             }
> }
> }
>
>
> I've also tried setting the form's maxSize like so, but the file still
> seems
> to get uploaded:
> setMaxSize(Bytes.kilobytes(150));
>
> Anyone run into this same problem? Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to