Re: Get the web uploaded file
Storm Linux User wrote: > > > > > Your tage is missing the ENCTYPE="multipart/form-data" tag. Without this your page does not return a file. sven -- == Sven E. van 't Veer http://www.cachoeiro.net Java Developer [EMAIL PROTECTED] ==
RE: Get the web uploaded file
Title: RE: Get the web uploaded file Hi. Check out the example given on www.orionsupport.com about FileUpload. The API docs has a 'snag': It talks about InputStream when it should be PostFileInputStream. This will be fixed in the near future. But to stay out of problems, check the orionsupport page. WR > -Original Message- > From: Storm Linux User [mailto:[EMAIL PROTECTED]] > Sent: den 12 november 2000 20:43 > To: Orion-Interest > Cc: [EMAIL PROTECTED] > Subject: Get the web uploaded file > > > At 15:00 12.11.00 , you wrote: > >It's not form commercial use. It's for my research project > for getting my > >master's degree in Electrical Engineering ... I'm not > concered about securety > >right now. > > > >then hack right on. will be fun. the security aspects of > this could easily > >fill a chapter of your thesis if it fits your topic ;-). > > Thanks, Robert. > > The problem is that I'm not able to get the file that I > uploaded using a HTML > form like: > > > > > > > How do I get the file in the servlet and make an object of it? > > I've tried: > > File f = (File)request.getAttribute("my_class_file"); > > But it does not work. It compiles if I change to: > > Object obj = request.getAttribute("my_class_file"); > > But then, how do I transform an Object to a File, and then, > as the file is a > compiled class, how do I create an instantiate this class to > call some > methods of it? > > Thanks again! > []s > Guilherme Ceschiatti > [EMAIL PROTECTED] >
Re: Get the web uploaded file
take a look at http://www.orionsupport.com/articles/fileupload.html Aniket At 01:13 AM 11/13/2000, you wrote: >At 15:00 12.11.00 , you wrote: > >It's not form commercial use. It's for my research project for getting my > >master's degree in Electrical Engineering ... I'm not concered about > securety > >right now. > > > >then hack right on. will be fun. the security aspects of this could easily > >fill a chapter of your thesis if it fits your topic ;-). > >Thanks, Robert. > >The problem is that I'm not able to get the file that I uploaded using a HTML >form like: > > > > > > >How do I get the file in the servlet and make an object of it? > >I've tried: > >File f = (File)request.getAttribute("my_class_file"); > >But it does not work. It compiles if I change to: > >Object obj = request.getAttribute("my_class_file"); > >But then, how do I transform an Object to a File, and then, as the file is a >compiled class, how do I create an instantiate this class to call some >methods of it? > >Thanks again! >[]s >Guilherme Ceschiatti >[EMAIL PROTECTED]
Re: Get the web uploaded file
Have a look at the com.oreilly.servlet.MultipartRequest utility class which encapsulates the details of the file upload specification (RFC 1867) parsing available here http://www.servlets.com/resources/com.oreilly.servlet/index.html An example servlet which uses this utility class is here... http://www.servlets.com/jsp/examples/ch04/index.html#ex04_17 Mike Storm Linux User wrote: > At 15:00 12.11.00 , you wrote: > >It's not form commercial use. It's for my research project for getting my > >master's degree in Electrical Engineering ... I'm not concered about securety > >right now. > > >then hack right on. will be fun. the security aspects of this could easily > >fill a chapter of your thesis if it fits your topic ;-). > > Thanks, Robert. > > The problem is that I'm not able to get the file that I uploaded using a HTML > form like: > > > > > > > How do I get the file in the servlet and make an object of it? > > I've tried: > > File f = (File)request.getAttribute("my_class_file"); > > But it does not work. It compiles if I change to: > > Object obj = request.getAttribute("my_class_file"); > > But then, how do I transform an Object to a File, and then, as the file is a > compiled class, how do I create an instantiate this class to call some > methods of it? > > Thanks again! > []s > Guilherme Ceschiatti > [EMAIL PROTECTED] -- Mike Clark Clarkware Consulting Enterprise Java Architecture, Design, Development http://www.clarkware.com
Re: Get the web uploaded file
> >File f = (File)request.getAttribute("my_class_file"); > >But it does not work. It compiles if I change to: > >Object obj = request.getAttribute("my_class_file"); > >But then, how do I transform an Object to a File, and then, as the file is a >compiled class, how do I create an instantiate this class to call some >methods of it? completely on the wrong track here. please check the servlet api docs to see what getAttribute is for. You'll be surprised ;-). >Thanks again! >[]s >Guilherme Ceschiatti >[EMAIL PROTECTED] (-) Robert Krüger (-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH (-) Brüder-Knauß-Str. 79 - 64285 Darmstadt, (-) Tel: 06151 665401, Fax: 06151 665373 (-) [EMAIL PROTECTED], www.signal7.de
Get the web uploaded file
At 15:00 12.11.00 , you wrote: >It's not form commercial use. It's for my research project for getting my >master's degree in Electrical Engineering ... I'm not concered about securety >right now. >then hack right on. will be fun. the security aspects of this could easily >fill a chapter of your thesis if it fits your topic ;-). Thanks, Robert. The problem is that I'm not able to get the file that I uploaded using a HTML form like: How do I get the file in the servlet and make an object of it? I've tried: File f = (File)request.getAttribute("my_class_file"); But it does not work. It compiles if I change to: Object obj = request.getAttribute("my_class_file"); But then, how do I transform an Object to a File, and then, as the file is a compiled class, how do I create an instantiate this class to call some methods of it? Thanks again! []s Guilherme Ceschiatti [EMAIL PROTECTED]