Hi,
Is MultipartParser the one from com.oreilly.servlets?

Is the same behavior observed using commons-fileupload
(http://jakarta.apache.org/commons/fileupload/), which is bundled with
tomcat so hopefully you can test it easily?

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: E Cunningham [mailto:[EMAIL PROTECTED]
>Sent: Thursday, April 08, 2004 2:35 PM
>To: Tomcat Users List
>Subject: Re: IIS mod_jk2 2.0.4 Bug???
>
>
>Follow-up:
>Using stock Tomcat 4.1.30 and a pretty vanilla
>DocUpload servlet we have been able to upload
>various sized files with out error. But when adding
>IIS and the redirector into the mix then we find
>that the files get corrupted if the size of the file
>is more than 55.1K (as described below).
>
>This is a major bug with JK2 2.0.4.
>
>The upload breaks between 56,462 and 56,562 bytes
>(where the 56,462 works and 56,562 fails).
>I've tested with the following sized files (in the
>format: archive size/actual size. '*' denotes
>breakage):
>
>2,149 bytes 1k
>11,184 bytes 10k
>21,224 bytes 20k
>41,302 bytes 40k
>51,340 bytes 50k
>56,360 bytes 55k
>56,462 bytes 55.1k
>56,562 bytes 55.2k *
>56,864 bytes 55.5k *
>61,380 bytes 60k   *
>81,458 bytes 80k   *
>
>Every one of these tests works without the IIS
>redirector. This is highly repeatable.
>
>Here is the DocUpload servlet:
>
>
>import javax.servlet.*;
>import javax.servlet.http.*;
>import java.io.*;
>import java.util.Hashtable;
>
>public class Upload extends HttpServlet
>{
>public void service(ServletRequest request,
>ServletResponse response)
>        throws IOException
>{
>       PrintWriter out = null;
>       try {
>               int id=0;
>
>               out = response.getWriter();
>
>               String file = new String("");
>
>               MultipartParser parser = new
>MultipartParser((HttpServletRequest)request, 1024 *
>1024);
>               Part aPart;
>               Hashtable formElements = new Hashtable();
>               while( (aPart = parser.readNextPart()) != null
>) {
>                       if( aPart.isParam() == true ) {
>                               ParamPart pPart = (ParamPart)aPart;
>                               String field = pPart.getName();
>                               String value = pPart.getStringValue();
>                               if(field != null) {
>                                       if(value == null)
>                                               value = "";
>                                       formElements.put(field, value);
>                               }
>                       }
>                       else if( aPart.isFile() == true ) {
>                               FilePart fPart = (FilePart)aPart;
>                               String field = fPart.getName();
>                               String fileName = fPart.getFileName();
>                               if(fileName != null) {
>                                       //write the image to a file
>                                       String dir = "";
>                                       File theFile = new File(dir,
fileName);
>                                       fPart.writeTo(theFile);
>                                       formElements.put(field,
fileName);
>                               }
>                       }
>               }
>               out.println("File upload success");
>       } catch (Exception e) {
>               out.println("An error occurred.");
>               e.printStackTrace(out);
>       }
>       out.flush();
>}
>}
>
>
>
>
>
>--- E Cunningham <[EMAIL PROTECTED]> wrote:
>>
>> We just downloaded the recently released 2.0.4
>> mod_jk2
>>
>> connector and found a bug.
>>
>> Upload a binary document that is larger than 48K
>> using a servlet that has been well tested for a few
>> years against straight Tomcat, mod_jk and previous
>> versions of mod_jk2 (v2.0.3) for both IIS and NSAPI.
>>
>> Then download using another well tested servlet only
>>
>> to find that the document was corrupted.
>>
>> Documents are missing 4 bytes at the 48305, 48318,
>> or
>> 48320 byte marker (varies depending on attempt;
>> reproduced with the same file uploaded several
>> times.
>>
>> We have not verified this yet using stock Tomcat
>> (4.1.29) and the stock doc upload servlet.
>>
>> Is there some sort of new configuration that is
>> needed
>>
>> to accompany this point release of mod_jk2?
>>
>> thanks,
>> e
>>
>>
>>
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! Finance Tax Center - File online. File on
>> time.
>> http://taxes.yahoo.com/filing.html
>>
>>
>---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> [EMAIL PROTECTED]
>> For additional commands, e-mail:
>> [EMAIL PROTECTED]
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Small Business $15K Web Design Giveaway
>http://promotions.yahoo.com/design_giveaway/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to