You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Servais, Pascal-Eric" <PE...@ACME-Multimedia.com> on 2000/11/27 23:05:57 UTC

File upload...

Is there anybody who could tell me how to process a file upload from a html
form after the user has submitted the form ? I guess that the
HttpServletRequest is implied but I have no idea how.
 
Thanks for any hint.

Pascal-Eric Servais ( http://pages.infinit.net/denethor
<http://pages.infinit.net/denethor>  ) 
Cognicase ( division Web )
--- 
PGP Fingerprint : 8D0C FB66 CAF0 B9B3 E925  8D2E 7BDB 1D47 DC0B 4AEA 
"Engagez-vous qu'ils disaient, vous allez voir du pays...", Anonyme 


Re: File upload...

Posted by Steve Ruby <st...@rubysolutions.com>.
The response will be multipart mime format you will most likely want
some utils to parts the multipart format, this one works well for me:

http://www.servlets.com/resources/com.oreilly.servlet/index.html

you'll then do something like this:

// parse the content and put the file in default directory
multi = new MultipartRequest(data.getRequest(), uploaddir);

// get the other parameters like this
multi.getParameter("paramname");



"Servais, Pascal-Eric" wrote:
> 
> Is there anybody who could tell me how to process a file upload from a html
> form after the user has submitted the form ? I guess that the
> HttpServletRequest is implied but I have no idea how.
> 
> Thanks for any hint.
> 
> Pascal-Eric Servais ( http://pages.infinit.net/denethor
> <http://pages.infinit.net/denethor>  )
> Cognicase ( division Web )
> ---
> PGP Fingerprint : 8D0C FB66 CAF0 B9B3 E925  8D2E 7BDB 1D47 DC0B 4AEA
> "Engagez-vous qu'ils disaient, vous allez voir du pays...", Anonyme

RE: File upload...

Posted by Doug Pedley <dp...@lookupguide.com>.
To receive a file you have to use a multipart request which HttpServletRequest
doesn't support yet. Try the replacement from O'Reilly:
http://www.servlets.com/resources/com.oreilly.servlet/index.html

It's well documented and works great for me.

-d

> -----Original Message-----
> From: Servais, Pascal-Eric [mailto:PEServais@ACME-Multimedia.com]
> Sent: Monday, November 27, 2000 2:06 PM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: File upload...
> 
> 
> Is there anybody who could tell me how to process a file upload 
> from a html
> form after the user has submitted the form ? I guess that the
> HttpServletRequest is implied but I have no idea how.
>  
> Thanks for any hint.
> 
> Pascal-Eric Servais ( http://pages.infinit.net/denethor
> <http://pages.infinit.net/denethor>  ) 
> Cognicase ( division Web )
> --- 
> PGP Fingerprint : 8D0C FB66 CAF0 B9B3 E925  8D2E 7BDB 1D47 DC0B 4AEA 
> "Engagez-vous qu'ils disaient, vous allez voir du pays...", Anonyme 
>