at http://www.servlets.com/resources/com.oreilly.servlet/index.html Etienne -----Original Message----- From: Valeriy Molyakov [mailto:[EMAIL PROTECTED]] Sent: mercredi 28 mars 2001 9:53 To: [EMAIL PROTECTED] Subject: Re: File Upload Hi! Where I can found class MultipartRequest ? ----- Original Message ----- From: "NSB)Hiroshi Kasamatsu" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 28, 2001 10:12 AM Subject: Re: File Upload > Hi,Fabien > > MultipartRequest works very fine. > You may use file stream wrongly. > > My coding is as follows. I make it in any file because of byte > input-output. > > MultipartRequest multi=new MultipartRequest(req,"."); > > Enumeration params=multi.getParameterNames(); > Enumeration files=multi.getFileNames(); > > > File f=null; > > String f_name=null; > while(files.hasMoreElements()){ > f_name=(String)files.nextElement(); > f_name=f_name.trim(); > > st_type=multi.getContentType(f_name); > f=multi.getFile(f_name); > } > > if(f!=null){ > FileInputStream fis=new FileInputStream(f); > > FileOutputStream fos=new FileOutputStream(fname); > int b; > while((b=fis.read())!=-1){ > fos.write((byte)b); > } > fis.close();fos.close(); > } > > > > > > > > > > Fabien Modoux wrote: > > > Hello, > > > > I am using Tomcat with Apache on Linux. I am using the OReilly > > package to upload files through a servlet, but it only works > > for text files. I found several messages in the archive about > > that, but haven't been able to find a good solution. Does > > anyone know how to go around or fix this problem. > > > > Thanks, > > > > -Fabien

Reply via email to