portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Torres" <ctor...@mcn.com.br>
Subject Re: File Upload
Date Thu, 03 Feb 2005 13:35:16 GMT
I used all of the answers and made this:

    private boolean uploadFile(RunData runData, String location)
    {
     boolean ok = false;
  try
  {
   Object filename = runData.getRequest().getParameter("filename");
   FileItem fi = runData.getParameters().getFileItem("filename");
   FileUploader fu = new FileUploader();
   ok = fu.upload(fi, location, null);
  }
  catch(Exception e)
  {
   System.out.println("uploadFile - ERRO: " + e.getMessage());
  }
  return ok;
 }

using a from with a input type=file and using a form as
<form method="post" enctype="multipart/form-data">

Thank you for all.

See you



----- Original Message ----- 
From: "Alan Chiang" <alan.chiang@gmail.com>
To: "Jetspeed Users List" <jetspeed-user@jakarta.apache.org>
Sent: Tuesday, February 01, 2005 4:42 PM
Subject: Re: File Upload


I pretty much followed the instructions in the link I sent you.  I
created a JSP page with a form, and used Turbine's parameter parser to
snag the FileItem.

If you read the FileItem's api, its very easy to use.  I just call a
write on the FileItem when I can confirm its all good.

Don't be afraid to read the API's, they can help you immensely.

I haven't converted my portlet to use commons-upload (or whatever its
called)

Alan


On Mon, 31 Jan 2005 19:07:17 -0300, Carlos Torres <ctorres@mcn.com.br>
wrote:
> Can you explain how you did it? Which classes you used, if any change was
> necessary.
>
> Thanks.
>
> ----- Original Message -----
> From: <apache@salesfactory.org>
> To: "'Jetspeed Users List'" <jetspeed-user@jakarta.apache.org>
> Sent: Monday, January 31, 2005 6:02 PM
> Subject: AW: File Upload
>
> Yeah, I did it ;)
>
> -----Urspr√ľngliche Nachricht-----
> Von: Carlos Torres [mailto:ctorres@mcn.com.br]
> Gesendet: Montag, 31. Januar 2005 22:59
> An: Apache JetSpeed User; Apache JetSpeed Dev
> Betreff: File Upload
>
>
> Hello all,
>
> Anybody made a page(portlet) with file upload using JetSpeed 1.5 ?
>
> Please help me.
>
> Thanks.
>
> Carlos Torres
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>
>


-- 
"Calling Canadian beef unsafe is like calling your twin sister ugly"
~ Mark Dopp

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message