Tapestry-upload component limit uploaded data

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Tapestry-upload component limit uploaded data

Peter Stavrinides
Hi

I wish to limit the types of files that are handled by the upload component (i.e: only excel and pdf files), but I can't seem to find this documented... I also tried it using the HTML parameter accept="application/excel, application/vnd.ms-excel, application/x-msexcel, application/ms-excel, application/pdf", but it still uploads everything. Sorry if this question is trivial, but I could use some pointers please.

Thanks
Peter


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tapestry-upload component limit uploaded data

Ulrich Stärk-4
You can write an org.apache.tapestry5.FieldValidator and bind it to your
upload component with the validate parameter.

Uli

Am Di, 8.07.2008, 11:02, schrieb Peter Stavrinides:

> Hi
>
> I wish to limit the types of files that are handled by the upload
> component (i.e: only excel and pdf files), but I can't seem to find this
> documented... I also tried it using the HTML parameter
> accept="application/excel, application/vnd.ms-excel,
> application/x-msexcel, application/ms-excel, application/pdf", but it
> still uploads everything. Sorry if this question is trivial, but I could
> use some pointers please.
>
> Thanks
> Peter
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Tapestry-upload component limit uploaded data

Ulrich Stärk-4
Or you could just use the regexp validator and filter on file names. See
http://tapestry.apache.org/tapestry5/tutorial1/forms.html for an example
how to use it.

Uli

Am Di, 8.07.2008, 11:11, schrieb Ulrich Stärk:

> You can write an org.apache.tapestry5.FieldValidator and bind it to your
> upload component with the validate parameter.
>
> Uli
>
> Am Di, 8.07.2008, 11:02, schrieb Peter Stavrinides:
>> Hi
>>
>> I wish to limit the types of files that are handled by the upload
>> component (i.e: only excel and pdf files), but I can't seem to find this
>> documented... I also tried it using the HTML parameter
>> accept="application/excel, application/vnd.ms-excel,
>> application/x-msexcel, application/ms-excel, application/pdf", but it
>> still uploads everything. Sorry if this question is trivial, but I could
>> use some pointers please.
>>
>> Thanks
>> Peter
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...