<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to bugs</title><link>https://sourceforge.net/p/multpartrequest/bugs/</link><description>Recent changes to bugs</description><atom:link href="https://sourceforge.net/p/multpartrequest/bugs/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 01 May 2007 15:47:40 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/multpartrequest/bugs/feed.rss" rel="self" type="application/rss+xml"/><item><title>Set encoding override not available</title><link>https://sourceforge.net/p/multpartrequest/bugs/8/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;In the 2.00b6 implementation the encoding is obtained from the context HttpServletRequest.getEncoding method.  However there should be provision to pass in an overriding encoding value.  This should be very straightforward, as the member to control the encoding is a instance member not a class member:&lt;/p&gt;
&lt;p&gt;private String m_charEncoding;&lt;/p&gt;
&lt;p&gt;Will add it to the main constructor in the 2.00b7 release&lt;/p&gt;
&lt;p&gt;Either that or provide the ability to set it via a system property.  I think the param is probably the best bet, and if its specified as null, use the default of ISO-8859-1&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason Pell</dc:creator><pubDate>Tue, 01 May 2007 15:47:40 -0000</pubDate><guid>https://sourceforge.net170dfe3033cbbb2a1102e2bab9c4c01e120be0e0</guid></item><item><title>ServletMultipartRequest.getFileContents(String) </title><link>https://sourceforge.net/p/multpartrequest/bugs/7/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;While trying to obtain file contents in a file whose length &lt;br /&gt;
is 0 (eg. an empty probe.txt), returns null.&lt;/p&gt;
&lt;p&gt;I suppose it's not the desirable behaviour. It avoids, for &lt;br /&gt;
example, preparing a file to attach in a web mail &lt;br /&gt;
application. No mail clients refuse to send an empty file...&lt;/p&gt;
&lt;p&gt;Best regards and thanks a lot&lt;/p&gt;
&lt;p&gt;carlos&lt;br /&gt;
cfmoro@correo.uniovi.es&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 25 Sep 2003 16:46:57 -0000</pubDate><guid>https://sourceforge.net70d62bcfc7df3c1f32401c0ae857b40fdf9e5d0c</guid></item><item><title>IE 6.0 upload problem</title><link>https://sourceforge.net/p/multpartrequest/bugs/6/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Jason:&lt;/p&gt;
&lt;p&gt;We have been tracing a very weird bug for quite a while&lt;br /&gt;
and have finally&lt;br /&gt;
found the issue.  Please see the following two postings&lt;br /&gt;
regarding two&lt;br /&gt;
separate bugs with dumb @#$$%&amp;amp;amp;^@#! IE browsers.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://bugs.php.net/bug.php?id=18792" rel="nofollow"&gt;http://bugs.php.net/bug.php?id=18792&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.servlets.com/blog/archives/000032.html" rel="nofollow"&gt;http://www.servlets.com/blog/archives/000032.html&lt;/a&gt;&lt;br /&gt;
(Look at the first&lt;br /&gt;
comment by user alim)&lt;/p&gt;
&lt;p&gt;Based on these two problems, may I propose the&lt;br /&gt;
following two changes to the&lt;br /&gt;
code:&lt;/p&gt;
&lt;p&gt;In initParser(...) determine the strBoundary as:&lt;/p&gt;
&lt;p&gt;strBoundary = null;&lt;br /&gt;
if (strContentTypeText!=null &amp;amp;amp;&amp;amp;amp;&lt;br /&gt;
strContentTypeText.toLowerCase().startsWith(&amp;amp;quot;multipart/form-data&amp;amp;quot;))&lt;br /&gt;
{&lt;br /&gt;
// This is done to handle IE and netscape&lt;br /&gt;
proxies incorrectly&lt;br /&gt;
setting the boundary&lt;br /&gt;
// (for this bug see&lt;br /&gt;
&lt;a href="http://bugs.php.net/bug.php?id=18792\" rel="nofollow"&gt;http://bugs.php.net/bug.php?id=18792\&lt;/a&gt;)&lt;br /&gt;
int startNdx =&lt;br /&gt;
strContentTypeText.indexOf(&amp;amp;quot;boundary=&amp;amp;quot;);&lt;br /&gt;
if (startNdx &amp;amp;gt;= 0) {&lt;br /&gt;
int endNdx =&lt;br /&gt;
strContentTypeText.indexOf(&amp;amp;quot;,&amp;amp;quot;,startNdx+9);&lt;br /&gt;
if (endNdx &amp;amp;lt; 0)&lt;br /&gt;
strBoundary =&lt;br /&gt;
strContentTypeText.substring(startNdx+9);&lt;br /&gt;
else&lt;br /&gt;
strBoundary =&lt;br /&gt;
strContentTypeText.substring(startNdx+9,endNdx);&lt;br /&gt;
strBoundary = strBoundary.trim();&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;if (strBoundary == null) {&lt;br /&gt;
// &amp;amp;lt;mtl,jpell&amp;amp;gt;&lt;br /&gt;
debug(&amp;amp;quot;ContentType = &amp;amp;quot; + strContentTypeText);&lt;br /&gt;
throw new IllegalArgumentException(&amp;amp;quot;Invalid&lt;br /&gt;
Content Type.&amp;amp;quot;);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;And then at the beginning of parse(..)&lt;/p&gt;
&lt;p&gt;// Must be boundary at top of loop, otherwise&lt;br /&gt;
we have finished.&lt;br /&gt;
// However, lovely IE 6.0 wigs out with some&lt;br /&gt;
strange chars in the&lt;br /&gt;
form fields&lt;br /&gt;
boolean foundFirstBoundary = false;&lt;br /&gt;
while ((read=readLine(in, blockOfBytes)) &amp;amp;gt; 0) {&lt;br /&gt;
strLine = (read&amp;amp;gt;0)? new&lt;br /&gt;
String(blockOfBytes, 0, read,&lt;br /&gt;
charEncoding): null;&lt;br /&gt;
if (strLine!=null &amp;amp;amp;&amp;amp;amp;&lt;br /&gt;
strLine.indexOf(this.strBoundary) &amp;amp;gt;= 0) {&lt;br /&gt;
foundFirstBoundary = true;&lt;br /&gt;
break;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
if (!foundFirstBoundary) {&lt;br /&gt;
throw new IOException(&amp;amp;quot;Invalid Form Data,&lt;br /&gt;
no boundary&lt;br /&gt;
encountered.&amp;amp;quot;);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Let me know.  As always, thanks&lt;/p&gt;
&lt;p&gt;-Luis&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason Pell</dc:creator><pubDate>Wed, 26 Feb 2003 05:41:37 -0000</pubDate><guid>https://sourceforge.netd23520ed20fe39c199ea54624865a1596aa94da1</guid></item><item><title>Problems with TrimQuotes method</title><link>https://sourceforge.net/p/multpartrequest/bugs/5/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Jason,&lt;/p&gt;
&lt;p&gt;I have recently come across another issue with the&lt;br /&gt;
multipart parser that you may wish to be aware of.&lt;/p&gt;
&lt;p&gt;I have had an issue raised with the parser:&lt;/p&gt;
&lt;p&gt;&amp;amp;quot;Creating a file with a japanese filename and writing a&lt;br /&gt;
japanese comment to that filename causes the following&lt;br /&gt;
exception:&lt;/p&gt;
&lt;p&gt;java.lang.StringIndexOutOfBoundsException: String index&lt;br /&gt;
out of range: -1&lt;br /&gt;
java.lang.String.charAt(String.java:460)&lt;br /&gt;
http.utils.multipartrequest.MultipartRequest.trimQuotes(MultipartRequest.java)&lt;br /&gt;
http.utils.multipartrequest.MultipartRequest.parse(MultipartRequest.java)&lt;br /&gt;
http.utils.multipartrequest.MultipartRequest.init(MultipartRequest.java)&lt;br /&gt;
http.utils.multipartrequest.MultipartRequest.(MultipartRequest.java)&lt;br /&gt;
&amp;amp;quot;&lt;/p&gt;
&lt;p&gt;More information can be found here:&lt;br /&gt;
&lt;a href="http://jira.atlassian.com/secure/ViewIssue.jspa?key=JRA-1255" rel="nofollow"&gt;http://jira.atlassian.com/secure/ViewIssue.jspa?key=JRA-1255&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;From looking at the code for trimQuotes, this exception&lt;br /&gt;
looks as though it can happen if you upload a file,&lt;br /&gt;
with a filename of a single quote, or a quote &amp;amp;amp; whitespace.&lt;/p&gt;
&lt;p&gt;private static final String trimQuotes (String strItem)&lt;br /&gt;
{&lt;br /&gt;
// Saves having to go any further....&lt;br /&gt;
if (strItem==null || strItem.indexOf(&amp;amp;quot;\&amp;amp;amp;quot;&amp;amp;quot;)==-1)&lt;br /&gt;
return strItem;&lt;/p&gt;
&lt;p&gt;// Get rid of any whitespace..&lt;br /&gt;
strItem = strItem.trim();&lt;/p&gt;
&lt;p&gt;if (strItem.charAt(0) == '\&amp;amp;amp;quot;')&lt;br /&gt;
strItem = strItem.substring(1);&lt;/p&gt;
&lt;p&gt;if (strItem.charAt(strItem.length()-1) == '\&amp;amp;amp;quot;')&lt;br /&gt;
strItem = strItem.substring(0, strItem.length()-1);&lt;/p&gt;
&lt;p&gt;return strItem;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;So trimQuotes(&amp;amp;quot;  \&amp;amp;amp;quot;  &amp;amp;quot;); will fail with an exception.&lt;/p&gt;
&lt;p&gt;The fix should be very simple, you need to change this&lt;br /&gt;
line:&lt;/p&gt;
&lt;p&gt;if (strItem.charAt(strItem.length()-1) == '\&amp;amp;amp;quot;')&lt;/p&gt;
&lt;p&gt;to&lt;/p&gt;
&lt;p&gt;if (strItem.length() &amp;amp;gt; 0 &amp;amp;amp;&amp;amp;amp;&lt;br /&gt;
strItem.charAt(strItem.length()-1) == '\&amp;amp;amp;quot;')&lt;/p&gt;
&lt;p&gt;I have no idea why this would happen on japanese&lt;br /&gt;
filenames though!&lt;/p&gt;
&lt;p&gt;Thanks for your help, and your response so far.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br /&gt;
Scott &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason Pell</dc:creator><pubDate>Wed, 26 Feb 2003 05:40:51 -0000</pubDate><guid>https://sourceforge.net0b983a4c3aeea1a3c170853857e7e4f7143cd306</guid></item><item><title>Compile MultipartRequest - with fix</title><link>https://sourceforge.net/p/multpartrequest/bugs/4/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;In &lt;/p&gt;
&lt;p&gt;public static synchronized void setEncoding(String&lt;br /&gt;
enc)throws UnsupportedEncodingException&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;new String(new byte[]{'\n'}, enc);&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;Needs to be changed to&lt;br /&gt;
new String(new byte[]{(byte)'\n'}, enc);&lt;/p&gt;
&lt;p&gt;on my machine.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rob Gaunt</dc:creator><pubDate>Tue, 22 Oct 2002 10:19:45 -0000</pubDate><guid>https://sourceforge.net0f268177529e111f1cb0d26d458d547ed46c9561</guid></item><item><title>Stream ended prematurely</title><link>https://sourceforge.net/p/multpartrequest/bugs/3/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;The class gives an error as &amp;amp;quot;Stream ended prematurely&amp;amp;quot; &lt;br /&gt;
while uploading .doc, .jpeg etc. It work proper only &lt;br /&gt;
for .txt, .htm, .html. And attimes for some of &lt;br /&gt;
the .doc files. Cannot guess the reason. Also if &lt;br /&gt;
the .doc, .jpeg files are uploaded they are possibly &lt;br /&gt;
corrupted, as they do not open. The MultiPartRequest &lt;br /&gt;
class is used with Tomacat 4.0.1-Apache on Linux 7.1.&lt;br /&gt;
What is going wrong is unpredictable, since the same &lt;br /&gt;
code works fine on Windows 98.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Mon, 08 Apr 2002 07:01:02 -0000</pubDate><guid>https://sourceforge.net3ab1efa317db4c530637a72e937ddc0b6cb42675</guid></item><item><title>Encoding and constructor</title><link>https://sourceforge.net/p/multpartrequest/bugs/2/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;br /&gt;
I have problem with MultipartRequest and international&lt;br /&gt;
characters in uft8 format. I can call method&lt;br /&gt;
setEncoding after constructor, but constructor parses&lt;br /&gt;
input request with default encoding iso-8859-1, so how&lt;br /&gt;
can I parse my request with desired encoding. For my&lt;br /&gt;
development first call for MultipartRequest parses data&lt;br /&gt;
incorectly (changes international characters to two&lt;br /&gt;
characters) but second call for this class seems to&lt;br /&gt;
work correctly. And this is my second doubt. Field&lt;br /&gt;
charEncoding is declared static. This is the reason why&lt;br /&gt;
second time parsing works but when on one container two&lt;br /&gt;
servlets will try to parse content with different&lt;br /&gt;
encogings there will be lots of problems. For me there&lt;br /&gt;
are two possible solutions (except removing static): &lt;br /&gt;
- add encoding parameter to constructor (less work)&lt;br /&gt;
- delay parsing of request till first call for&lt;br /&gt;
retriving   data from it (like it works with original&lt;br /&gt;
HttpServletRequest (at least in tomcat)), which is my&lt;br /&gt;
favourite solution, but reqires little bit more codding&lt;/p&gt;
&lt;p&gt;If you want I can make some of coding and send you&lt;br /&gt;
resoults. For now solution for me is to simply change&lt;br /&gt;
default encoding for utf8&lt;/p&gt;
&lt;p&gt;Best Regards&lt;/p&gt;
&lt;p&gt;Jacek Bator&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jacek Bator</dc:creator><pubDate>Fri, 08 Mar 2002 12:02:16 -0000</pubDate><guid>https://sourceforge.net8e887cf01576d06cad1047b66c7be06e73b3a4f6</guid></item><item><title>IE4 on Mac</title><link>https://sourceforge.net/p/multpartrequest/bugs/1/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;IE4 on a mac adds extra empty lines after last&lt;br /&gt;
boundary.  This causes MultipartRequest to break as it&lt;br /&gt;
assumes another url parameter.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jason Pell</dc:creator><pubDate>Thu, 14 Feb 2002 07:48:31 -0000</pubDate><guid>https://sourceforge.net413b453a91b85185c83591f7a82e7045e01cf19b</guid></item></channel></rss>