You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Helmut Swaczinna <sw...@wlp-systems.de> on 2007/05/24 15:30:04 UTC

[Tobago] How does tc:validateFileItem check the contentType?

Hi,

what mechanism/tool uses tc:validateFileItem to determine the MIME-Type of 
the uploaded file to
check the specified contentType? I want to restrict the file upload to Excel 
files but it doesn't recognize
the upload file as an Excel file.

Regards
Helmut 



Re: [Tobago] How does tc:validateFileItem check the contentType?

Posted by Volker Weber <v....@inexso.de>.
Hi Helmut,

tobago utilises commons-fileUpload and for the contentType
FileItem.getContentType():
http://jakarta.apache.org/commons/fileupload/apidocs/org/apache/commons/fileupload/FileItem.html#getContentType()

from this doc i think the uploading browser must set the contenttype
properly for this to work.


Regards,
    Volker

2007/5/24, Helmut Swaczinna <sw...@wlp-systems.de>:
> Hi,
>
> what mechanism/tool uses tc:validateFileItem to determine the MIME-Type of
> the uploaded file to
> check the specified contentType? I want to restrict the file upload to Excel
> files but it doesn't recognize
> the upload file as an Excel file.
>
> Regards
> Helmut
>
>
>