|
"FileUpload parses HTTP requests which conform to RFC 1867, "Form-based File Upload in HTML". That is, if an HTTP request is submitted using the POST method, and with a content type of "multipart/form-data", then FileUpload can parse that request, and make the results available in a manner easily used by the caller. "
this text is copied from http://commons.apache.org/fileupload/ As i see this is simple task to support both commas and semi-colons. Why continue to support semi-colons? The spec doesn't seem to mention them.
Do browsers tend to send ; and not , as the spec says? Yes, as i looked browsers tend to send semi-colons.But not only web browsers can submit files to server using this method. For example I made some embedded device witch is sending some generated files to Server. File upload part I done using RFC 1867.I didn't look at others rfc looking if there is some mistake in this one. So i have done device which is sending files to some server. If my written script is good I tested on simple php script. There was no problem. So we produced a lot of these devices (i can't change soft in them). Then I began making server on Java using this library . So occurred a problem. At moment i use some decorator witch replaces commas to semi-colons. But as I suppose it should be fixed in library because i may be not only one who is writing simple code using this rfc without checking if its conflicting with other rfc documents.
Makes sense. Assigning to 1.2.1.
Attaching a patch which adds a new parse method to ParameterParser that can take multiple separators. It looks for the earliest one that occurs in the string to be parsed, and uses that.
Unit test also patched, as is the getBoundary method to use this new parse(String, char[]) method. After reviewing, I can't fight the feeling, that the ParameterParser could use some refactoring in order to reduce the number of similar methods. However, IMO, we should reuse mime4j in the next version anyways, so that can be ignored for now. Go on, Henri!
svn ci -m "Applying the patch from
Sending src/java/org/apache/commons/fileupload/FileUploadBase.java |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I guess we need to figure out whether browsers are sending semi-colons or commas. Maybe this part of the spec gets ignored.
[Completely odd fact... the Habsburgs ruled Hungary from 1521 to 1867]