You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by ap...@salesfactory.org on 2005/01/31 22:02:36 UTC

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


Re: File Upload

Posted by Carlos Torres <ct...@mcn.com.br>.
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" <al...@gmail.com>
To: "Jetspeed Users List" <je...@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 <ct...@mcn.com.br>
wrote:
> Can you explain how you did it? Which classes you used, if any change was
> necessary.
>
> Thanks.
>
> ----- Original Message -----
> From: <ap...@salesfactory.org>
> To: "'Jetspeed Users List'" <je...@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-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org


Re: File Upload

Posted by Carlos Torres <ct...@mcn.com.br>.
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" <al...@gmail.com>
To: "Jetspeed Users List" <je...@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 <ct...@mcn.com.br>
wrote:
> Can you explain how you did it? Which classes you used, if any change was
> necessary.
>
> Thanks.
>
> ----- Original Message -----
> From: <ap...@salesfactory.org>
> To: "'Jetspeed Users List'" <je...@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


Re: File Upload

Posted by Alan Chiang <al...@gmail.com>.
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 <ct...@mcn.com.br> wrote:
> Can you explain how you did it? Which classes you used, if any change was
> necessary.
> 
> Thanks.
> 
> ----- Original Message -----
> From: <ap...@salesfactory.org>
> To: "'Jetspeed Users List'" <je...@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


AW: File Upload

Posted by ap...@salesfactory.org.
 public void doUploaddhl(RunData rundata, Context context) throws Exception
  {
    try
    {
      FileItem fi = rundata.getParameters().getFileItem("filename");
      OrderManager om = new OrderManager();
      om.importTrackAndTrace(fi.getStream());
    }
    catch(Exception e)
    {
      logger.error("tt-import-failure: " + e);
    }
  }

the fileitem returns a stream, which you can handle. filename is the name of
the html-form-element

-----Ursprüngliche Nachricht-----
Von: Carlos Torres [mailto:ctorres@mcn.com.br] 
Gesendet: Montag, 31. Januar 2005 23:07
An: Jetspeed Users List
Betreff: Re: File Upload


Can you explain how you did it? Which classes you used, if any change was
necessary.

Thanks.

----- Original Message ----- 
From: <ap...@salesfactory.org>
To: "'Jetspeed Users List'" <je...@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




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


Re: File Upload

Posted by Carlos Torres <ct...@mcn.com.br>.
Can you explain how you did it? Which classes you used, if any change was
necessary.

Thanks.

----- Original Message ----- 
From: <ap...@salesfactory.org>
To: "'Jetspeed Users List'" <je...@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