|
It is already possible to set the header encoding on a per-instance basis using
FileUploadBase.setHeaderEncoding(). I admit that's a little buried, which is why I'm going to leave this bug report open for now. I do not like the idea of using a static default value for exactly the reason you state - it will cause problems, and likely much confusion, in situations where a shared FileUpload jar is in use. Martin,
Now, I am confused: The javadoc for FileUploadBase.setHeaderEncoding() says:
In fact, I see that struts as I am using it in Short from patching struts, I do not see an option where I as an application So, what is probably needed that the FileUpload has an init() that creates a If you look at that particular code in Struts, you will see:
// The following line is to support an "EncodingFilter" The comment is important... Thx, this is an interesting hint, haven't tested it but I trust the folks over
there did. Suggestion: for a new javadoc for the FileUploadBase.setHeaderEncoding():
more on struts possibly not really doing it right --> more on struts possibly not really doing it right --> Bug 34445
Closing this as fixed, since the encoding used may be specified using the
FileUpload.setHeaderEncoding() method. If that returns null, the encoding is taken from the request object, and so may be set using request.setCharacterEncoding() before invoking FileUpload.parseRequest(). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
MultipartStream.java.patch
To have this effective, after loading, an init() must set the
org.apache.commons.fileupload.MultipartStream.headerEncodingDefault
— since this is static, this obviously only works if the fileUpload.jar is
not shared between the web-apps.
see also Created an attachment (id=14702)
MultipartStream.java.patch
To have this effective, after loading, an init() must set the
org.apache.commons.fileupload.MultipartStream.headerEncodingDefault
— since this is static, this obviously only works if the fileUpload.jar is
not shared between the web-apps.
see also Bug 34291