You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ângelo Dias <ag...@live.it> on 2010/01/06 12:25:21 UTC

Trinidad input file

Hi folks,

 

First of all, I would like to say sorry either  if my question is too basic or if it was made in the wrong list.

 

I´m trying the input file component and I´m confused about how to code the file upload. Since I have already the file input stream, is it enough to read the stream and write 

in the local disk?

Should I use Apache Commons File Upload or should I only use the streams to read and write the file?

 

Do you have a piece of code to do this?

 

Thanks in advance.

 

Ângelo
 		 	   		  
_________________________________________________________________
Non sei a casa? Prova il nuovo Web Messenger
http://www.messenger.it/web/default.aspx

Re: Trinidad input file

Posted by Matthias Wessendorf <ma...@apache.org>.
Hello,

2010/1/6 Ângelo Dias <ag...@live.it>:
>
> Hi folks,
>
>
>
> First of all, I would like to say sorry either  if my question is too basic or if it was made in the wrong list.

nope. the users@ list is correct

>
>
>
> I´m trying the input file component and I´m confused about how to code the file upload. Since I have already the file input stream, is it enough to read the stream and write
>
> in the local disk?
>
> Should I use Apache Commons File Upload or should I only use the streams to read and write the file?
>
>
>
> Do you have a piece of code to do this?


Dont use Commons Upload; Trinidad has integrated support for doing uploads.

some documentation:
http://myfaces.apache.org/trinidad/devguide/fileUpload.html

Here is short extract from our demo application, for your requested code sample:

JSPX page:
http://svn.apache.org/repos/asf/myfaces/trinidad/trunk/trinidad-examples/trinidad-demo/src/main/webapp/components/inputFile.jspx

backing bean, that is behind the page:
http://svn.apache.org/repos/asf/myfaces/trinidad/trunk/trinidad-examples/trinidad-demo/src/main/java/org/apache/myfaces/trinidaddemo/UIBean.java

You can download the demo from here:
http://myfaces.apache.org/trinidad/download.html

HTH,
Matthias


>
>
>
> Thanks in advance.
>
>
>
> Ângelo
>
> _________________________________________________________________
> Non sei a casa? Prova il nuovo Web Messenger
> http://www.messenger.it/web/default.aspx



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: Trinidad input file

Posted by Scott O'Bryan <da...@gmail.com>.
Angelo,

Actually, Trinidad manages the input stream for you.  I think the Tag
Documentation available on the website will tell you how to use it.

Scott

Sent from my iPhone

On Jan 6, 2010, at 4:25 AM, Ângelo Dias <ag...@live.it> wrote:

>
> Hi folks,
>
>
>
> First of all, I would like to say sorry either  if my question is
> too basic or if it was made in the wrong list.
>
>
>
> I´m trying the input file component and I´m confused about how to co
> de the file upload. Since I have already the file input stream, is i
> t enough to read the stream and write
>
> in the local disk?
>
> Should I use Apache Commons File Upload or should I only use the
> streams to read and write the file?
>
>
>
> Do you have a piece of code to do this?
>
>
>
> Thanks in advance.
>
>
>
> Ângelo
>
> _________________________________________________________________
> Non sei a casa? Prova il nuovo Web Messenger
> http://www.messenger.it/web/default.aspx