You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "spencer.c" <sp...@gmail.com> on 2007/09/21 18:30:48 UTC

Possible to validate file size prior to sending?

I have a form with a FileUploadField, where the maximum file size is fairly
large (100-200MB).  

I set the maximum size using the form's: setMaxSize(Bytes.megabytes(200));

This works fine, as the form only gets processed when the file is under that
size.  However, if the file is over that size, the user is not notified
until the upload completes, or at least gets beyond the limit.  So if
someone were to upload a 300 MB file, they won't find out that the file is
too large until after they exceed 200 MB sent, which can be a long time.

Can anything be done to validate the file size prior to exceeding the
maximum file size?  I think that if the file size is exceeded, the form
never gets processed at all, so server side it seems like it would be out,
but if I could add a client side validation in addition to the server side
validation, that would be great.

Has anyone else run into this?  



-- 
View this message in context: http://www.nabble.com/Possible-to-validate-file-size-prior-to-sending--tf4497198.html#a12825206
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Possible to validate file size prior to sending?

Posted by Johan Compagner <jc...@gmail.com>.
wow, uploading 200+mb files! and you still go over that?
i don't think
we get the size somehow in advance

On 9/21/07, spencer.c <sp...@gmail.com> wrote:
>
> I have a form with a FileUploadField, where the maximum file size is fairly
> large (100-200MB).
>
> I set the maximum size using the form's: setMaxSize(Bytes.megabytes(200));
>
> This works fine, as the form only gets processed when the file is under that
> size.  However, if the file is over that size, the user is not notified
> until the upload completes, or at least gets beyond the limit.  So if
> someone were to upload a 300 MB file, they won't find out that the file is
> too large until after they exceed 200 MB sent, which can be a long time.
>
> Can anything be done to validate the file size prior to exceeding the
> maximum file size?  I think that if the file size is exceeded, the form
> never gets processed at all, so server side it seems like it would be out,
> but if I could add a client side validation in addition to the server side
> validation, that would be great.
>
> Has anyone else run into this?
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Possible-to-validate-file-size-prior-to-sending--tf4497198.html#a12825206
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Possible to validate file size prior to sending?

Posted by Frank Bille <fr...@apache.org>.
Hi

I can see your problem, but AFAIK it's not possible to that kind of check
using javascript (perhaps in IE, some versions). Perhaps use a client side
solution instead, like java applet or flash?

Frank


On 9/21/07, spencer.c <sp...@gmail.com> wrote:
>
>
> I have a form with a FileUploadField, where the maximum file size is
> fairly
> large (100-200MB).
>
> I set the maximum size using the form's: setMaxSize(Bytes.megabytes(200));
>
> This works fine, as the form only gets processed when the file is under
> that
> size.  However, if the file is over that size, the user is not notified
> until the upload completes, or at least gets beyond the limit.  So if
> someone were to upload a 300 MB file, they won't find out that the file is
> too large until after they exceed 200 MB sent, which can be a long time.
>
> Can anything be done to validate the file size prior to exceeding the
> maximum file size?  I think that if the file size is exceeded, the form
> never gets processed at all, so server side it seems like it would be out,
> but if I could add a client side validation in addition to the server side
> validation, that would be great.
>
> Has anyone else run into this?
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Possible-to-validate-file-size-prior-to-sending--tf4497198.html#a12825206
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>